Code
forward LoadPlayerData(playerid, l_step);
public LoadPlayerData(playerid, l_step)
{
switch(l_step)
{
case 1:
{
new count, hour, minute, second;
gettime(hour, minute, second);
if(count)
{
LoginScreen(playerid,0);
gPlayerAccount[playerid] = 1;
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "Willkommen auf Coming Soon\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","OK"," ");
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
else
{
if(hour < 8)
{
LoginScreen(playerid,0);
ShowPlayerDialog(playerid,636,DIALOG_STYLE_MSGBOX,"Coming Soon","Hallo,\ndie Registartion ist Nachts von 0-8 Uhr geschlossen.\nDer Grund dafür sind Cheater etc.\nWir bitten um Verständnis!\n","Bestätigen","");
SetTimerEx("ConnectKick", 700,0,"i",playerid);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
return 1;
}
gPlayerAccount[playerid] = 0;
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX,"Coming Soon","Willkommen auf Coming Soon\n\nEs wurde kein Account unter diesen Namen gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!","OK","");
LoginScreen(playerid,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
return 1;
}
}
case 2:
{
cache_get_value_name_int(0,"Level", PlayerInfo[playerid][pLevel]);
cache_get_value_name_int(0,"AdminLevel",PlayerInfo[playerid][pAdmin]);
cache_get_value_name_int(0,"Checkpoint", CCP[playerid]);
cache_get_value_name_int(0,"CPrison", xPrison[playerid]);
cache_get_value_name_int(0,"RunningCP", RunningCP[playerid]);
cache_get_value_name_int(0,"BNDRadar", BNDRadar[playerid]);
cache_get_value_name_int(0,"TeamRadar", TeamRadar[playerid]);
cache_get_value_name_int(0,"Rolex", PlayerInfo[playerid][pRolex]);
cache_get_value_name_int(0,"Swissonic", PlayerInfo[playerid][pSwissonic]);
cache_get_value_name_int(0,"Casio", PlayerInfo[playerid][pCasio]);
cache_get_value_name_int(0,"Breitling", PlayerInfo[playerid][pBreitling]);
cache_get_value_name_int(0,"Nixon", PlayerInfo[playerid][pNixon]);
cache_get_value_name_int(0,"IceWatch", PlayerInfo[playerid][pIceWatch]);
cache_get_value_name_int(0,"StartCoints", PlayerInfo[playerid][pStartCoints]);
cache_get_value_name_int(0,"Coints", PlayerInfo[playerid][pCoints]);
cache_get_value_name_int(0,"SpawnhealZeit", PlayerInfo[playerid][pSpawnhealZeit]);
cache_get_value_name_int(0,"DeaglespawnZeit", PlayerInfo[playerid][pDeaglespawnZeit]);
cache_get_value_name_int(0,"M4SpawnZeit", PlayerInfo[playerid][pM4SpawnZeit]);
cache_get_value_name_int(0,"MP5SpawnZeit", PlayerInfo[playerid][pMP5SpawnZeit]);
cache_get_value_name_int(0,"MehrZinsenZeit", PlayerInfo[playerid][pMehrZinsenZeit]);
cache_get_value_name_int(0,"Medickit", PlayerInfo[playerid][pMedickit]);
cache_get_value_name_int(0,"Kreditkarte", PlayerInfo[playerid][pKreditkarte]);
cache_get_value_name_int(0,"KreditkarteBenutzung", PlayerInfo[playerid][pKreditkartebenutzen]);
cache_get_value_name_int(0,"Personalausweis", PlayerInfo[playerid][pPersonalausweis]);
cache_get_value_name_int(0,"Namechange", PlayerInfo[playerid][pSchongeandert]);
cache_get_value_name_int(0,"DonateRank", PlayerInfo[playerid][pDonatorRank]);
cache_get_value_name_int(0,"UpgradePoints", PlayerInfo[playerid][gPupgrade]);
cache_get_value_name_int(0,"ConnectedTime", PlayerInfo[playerid][pConnectTime]);
cache_get_value_name_int(0,"Registered", PlayerInfo[playerid][pReg]);
cache_get_value_name_int(0,"Sex", PlayerInfo[playerid][pSex]);
cache_get_value_name_int(0,"Age", PlayerInfo[playerid][pAlter]);
cache_get_value_name_int(0,"Origin", PlayerInfo[playerid][pOrigin]);
cache_get_value_name_int(0,"Muted", PlayerInfo[playerid][pMuted]);
cache_get_value_name_int(0,"Respect", PlayerInfo[playerid][pRespekt]);
cache_get_value_name_int(0,"Gehalt", PlayerInfo[playerid][pGehalt]);
cache_get_value_name_int(0,"Money", PlayerInfo[playerid][pCash]);
cache_get_value_name_int(0,"Bank", PlayerInfo[playerid][pBank]);
cache_get_value_name_int(0,"Jobgeld", PlayerInfo[playerid][pJobLohn]);
cache_get_value_name_int(0,"Crimes", PlayerInfo[playerid][pCrimes]);
cache_get_value_name_int(0,"Kills", PlayerInfo[playerid][pKills]);
cache_get_value_name_int(0,"sKills", PlayerInfo[playerid][psKills]);
cache_get_value_name_int(0,"Deaths", PlayerInfo[playerid][pDeaths]);
cache_get_value_name_int(0,"Arrested", PlayerInfo[playerid][pArrested]);
cache_get_value_name_int(0,"ArrestTime", PlayerInfo[playerid][pArrestTime]);
cache_get_value_name_int(0,"PhoneBook", PlayerInfo[playerid][pPhoneBook]);
cache_get_value_name_int(0,"LottoNr", PlayerInfo[playerid][pLottoNr]);
cache_get_value_name_int(0,"Fishes", PlayerInfo[playerid][pFishes]);
cache_get_value_name_int(0,"BiggestFish", PlayerInfo[playerid][pBiggestFish]);
cache_get_value_name_int(0,"Job", PlayerInfo[playerid][pJob]);
cache_get_value_name_int(0,"House", PlayerInfo[playerid][pHaus]);
cache_get_value_name_int(0,"Mieten", PlayerInfo[playerid][pMieten]);
cache_get_value_name_int(0,"HealPaket", PlayerInfo[playerid][pHealPaket]);
cache_get_value_name_int(0,"ArmourPaket", PlayerInfo[playerid][pArmourPaket]);
cache_get_value_name_int(0,"WaffenPaket", PlayerInfo[playerid][pWaffenPaket]);
cache_get_value_name_int(0,"OverHealPaket", PlayerInfo[playerid][pOverHealPaket]);
cache_get_value_name_int(0,"HeadValue", PlayerInfo[playerid][pHeadValue]);
cache_get_value_name_int(0,"Jailed", PlayerInfo[playerid][pJailed]);
cache_get_value_name_int(0,"JailTime", PlayerInfo[playerid][pJailTime]);
cache_get_value_name_int(0,"Leader", PlayerInfo[playerid][pLeader]);
cache_get_value_name_int(0,"Member", PlayerInfo[playerid][pMember]);
cache_get_value_name_int(0,"Rank", PlayerInfo[playerid][pRank]);
cache_get_value_name_int(0,"Skin", PlayerInfo[playerid][pChar]);
cache_get_value_name_int(0,"Vertragszeit", PlayerInfo[playerid][pVertragszeit]);
cache_get_value_name_int(0,"NewsSkill", PlayerInfo[playerid][pNewsSkill]);
cache_get_value_name_int(0,"FishSkill", PlayerInfo[playerid][pFishSkill]);
cache_get_value_name_int(0,"MechSkill", PlayerInfo[playerid][pMechSkill]);
cache_get_value_name_float(0,"pSHealth", PlayerInfo[playerid][pSHealth]);
cache_get_value_name_int(0,"PhoneNr", PlayerInfo[playerid][pNummer]);
cache_get_value_name_int(0,"Hotel", PlayerInfo[playerid][pPhotelkey]);
cache_get_value_name_int(0,"Biz", PlayerInfo[playerid][pBizKey]);
cache_get_value_name_int(0,"CarLic", PlayerInfo[playerid][pCarLic]);
cache_get_value_name_int(0,"FlyLic", PlayerInfo[playerid][pFlyLic]);
cache_get_value_name_int(0,"BoatLic", PlayerInfo[playerid][pBoatLic]);
cache_get_value_name_int(0,"FishLic", PlayerInfo[playerid][pFishLic]);
cache_get_value_name_int(0,"GunLic", PlayerInfo[playerid][pGunLic]);
cache_get_value_name_int(0,"Zollpass", PlayerInfo[playerid][pZollpass]);
cache_get_value_name_int(0,"Gun1", PlayerInfo[playerid][pGun1]);
cache_get_value_name_int(0,"Gun2", PlayerInfo[playerid][pGun2]);
cache_get_value_name_int(0,"Gun3", PlayerInfo[playerid][pGun3]);
cache_get_value_name_int(0,"Gun4", PlayerInfo[playerid][pGun4]);
cache_get_value_name_int(0,"Ammo1", PlayerInfo[playerid][pAmmo1]);
cache_get_value_name_int(0,"Ammo2", PlayerInfo[playerid][pAmmo2]);
cache_get_value_name_int(0,"Ammo3", PlayerInfo[playerid][pAmmo3]);
cache_get_value_name_int(0,"Ammo4", PlayerInfo[playerid][pAmmo4]);
cache_get_value_name_int(0,"CarTime", PlayerInfo[playerid][pCarTime]);
cache_get_value_name_int(0,"PayDay", PlayerInfo[playerid][pPayDay]);
cache_get_value_name_int(0,"PayDayHad", PlayerInfo[playerid][pPayDayHad]);
cache_get_value_name_int(0,"CDPlayer", PlayerInfo[playerid][pCDPlayer]);
cache_get_value_name_int(0,"AlcoholPerk", PlayerInfo[playerid][pAlcoholPerk]);
cache_get_value_name_int(0,"DrugPerk", PlayerInfo[playerid][pDrugPerk]);
cache_get_value_name_int(0,"MiserPerk", PlayerInfo[playerid][pMiserPerk]);
cache_get_value_name_int(0,"TraderPerk", PlayerInfo[playerid][pTraderPerk]);
cache_get_value_name_int(0,"PainKillerPerk", PlayerInfo[playerid][pPainKillerPerk]);
cache_get_value_name_int(0,"PistolSkill", PlayerInfo[playerid][pPistolSkill]);
cache_get_value_name_int(0,"MaschinePistolSkill", PlayerInfo[playerid][pMaschinePistolSkill]);
cache_get_value_name_int(0,"SturmgewehrPistolSkill", PlayerInfo[playerid][pSturmgewehrPistolSkill]);
cache_get_value_name_int(0,"ShotGunSkill", PlayerInfo[playerid][pShotGunSkill]);
cache_get_value_name_int(0,"Tutorial", PlayerInfo[playerid][pTut]);
cache_get_value_name_int(0,"Cptut", PlayerInfo[playerid][pCPTUT]);
cache_get_value_name_int(0,"kh", PlayerInfo[playerid][pKHTIME]);
cache_get_value_name_int(0,"Warnings", PlayerInfo[playerid][pWarns]);
cache_get_value_name_int(0,"Fuel", PlayerInfo[playerid][pFuel]);
cache_get_value_name_int(0,"Married", PlayerInfo[playerid][pMarried]);
cache_get_value_name_int(0,"MarriedTo", PlayerInfo[playerid][pMarriedTo]);
cache_get_value_name_int(0,"WantedLevel", PlayerInfo[playerid][pWantedLevel]);
cache_get_value_name_int(0,"Spawn", PlayerInfo[playerid][pSpawn]);
cache_get_value_name_int(0,"SavedMaterials", PlayerInfo[playerid][pSaveMats]);
cache_get_value_name_int(0,"SavedDrugs", PlayerInfo[playerid][pSaveDrugs]);
cache_get_value_name_int(0,"BikeLic", PlayerInfo[playerid][pBikeLic]);
cache_get_value_name_int(0,"LKWLic", PlayerInfo[playerid][pLKWLic]);
cache_get_value_name_int(0,"DonatorTime", PlayerInfo[playerid][pDonatorZeit]);
cache_get_value_name_int(0,"WerberName", PlayerInfo[playerid][pWerberName]);
cache_get_value_name_int(0,"FightingStyle", PlayerInfo[playerid][pFightingStyle]);
cache_get_value_name_int(0,"Handy", PlayerInfo[playerid][pHandy]);
cache_get_value_name_int(0,"OnDutySkin", PlayerInfo[playerid][pOnDutySkin]);
cache_get_value_name_int(0,"CarLicPoints", PlayerInfo[playerid][pCarLicPoints]);
cache_get_value_name_int(0,"BikeLicPoints", PlayerInfo[playerid][pBikeLicPoints]);
cache_get_value_name_int(0,"InviteSperre", PlayerInfo[playerid][pInviteSperre]);
cache_get_value_name_int(0,"warntime1", PlayerInfo[playerid][pWarnTime1]);
cache_get_value_name_int(0,"warntime2", PlayerInfo[playerid][pWarnTime2]);
cache_get_value_name_int(0,"Ticketsopen", PlayerInfo[playerid][pTicketsopen]);
cache_get_value_name_int(0,"OldName", PlayerInfo[playerid][pOldName]);
cache_get_value_name_int(0,"OrgMember", PlayerInfo[playerid][pOrgaID]);
cache_get_value_name_int(0,"OrgLeader", PlayerInfo[playerid][pOrgaLeader]);
cache_get_value_name_int(0,"OrgManager", PlayerInfo[playerid][pOrgaManager]);
cache_get_value_name_int(0,"OrgName", PlayerInfo[playerid][pOrgaName]);
cache_get_value_name_int(0,"SQLid", PlayerInfo[playerid][pSQLID]);
return 1;
}
default:
{
Kick(playerid);
return 1;
}
}
return 1;
}
Alles anzeigen
Warum werde ich sofort gekickt?
Unter OnPlayerRequestClass
new string[128];
mysql_format(handle, string, sizeof(string), "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'", SpielerName(playerid));
mysql_pquery(handle, string, "LoadPlayerData", "d", playerid);