if(dialogid == DIALOG_LOGIN)
{
if(response && strlen(inputtext) > 0)
{
new query[265],val[128],string[40];
format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `name`='%s' AND `passwort`='%s'", SpielerInfo[playerid][Name], inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows())
{
SetPlayerHealth(playerid,100);
printf("Spieler %s wird geladen", SpielerInfo[playerid][Name]);
mysql_fetch_field("banned",val); SpielerInfo[playerid][pGebannt] = strval(val);
mysql_fetch_field("admin",val); SpielerInfo[playerid][pAdmin] = strval(val);
mysql_fetch_field("donater",val); SpielerInfo[playerid][pDonateRank] = strval(val);
mysql_fetch_field("upgradepoints",val); SpielerInfo[playerid][gPupgrade] = strval(val);
mysql_fetch_field("reg",val); SpielerInfo[playerid][pReg] = strval(val);
mysql_fetch_field("sex",val); SpielerInfo[playerid][pSex] = strval(val);
mysql_fetch_field("exp",val); SpielerInfo[playerid][pExp] = strval(val);
mysql_fetch_field("level",val); SpielerInfo[playerid][pAge] = strval(val);
mysql_fetch_field("hand",val); SpielerInfo[playerid][pCash] = strval(val);
print("1");
mysql_fetch_field("konto",val); SpielerInfo[playerid][pAccount] = strval(val);
mysql_fetch_field("crimes",val); SpielerInfo[playerid][pCrimes] = strval(val);
mysql_fetch_field("arrested",val); SpielerInfo[playerid][pArrested] = strval(val);
mysql_fetch_field("wanteddeaths",val); SpielerInfo[playerid][pWantedDeaths] = strval(val);
mysql_fetch_field("phonebook",val); SpielerInfo[playerid][pPhoneBook] = strval(val);
mysql_fetch_field("lottonr",val); SpielerInfo[playerid][pLottoNr] = strval(val);
mysql_fetch_field("fishes",val); SpielerInfo[playerid][pFishes] = strval(val);
mysql_fetch_field("biggestfish",val); SpielerInfo[playerid][pBiggestFish] = strval(val);
mysql_fetch_field("job",val); SpielerInfo[playerid][sJob] = strval(val);
mysql_fetch_field("kills",val); SpielerInfo[playerid][pKills] = strval(val);
mysql_fetch_field("deaths",val); SpielerInfo[playerid][pDeaths] = strval(val);
mysql_fetch_field("jobgehalt",val); SpielerInfo[playerid][pJobGehalt] = strval(val);
mysql_fetch_field("headvalue",val); SpielerInfo[playerid][pHeadValue] = strval(val);
mysql_fetch_field("jailed",val); SpielerInfo[playerid][pJailed] = strval(val);
mysql_fetch_field("jailtime",val); SpielerInfo[playerid][pJailTime] = strval(val);
mysql_fetch_field("mats",val); SpielerInfo[playerid][pMats] = strval(val);
mysql_fetch_field("gras",val); SpielerInfo[playerid][pGras] = strval(val);
print("2");
mysql_fetch_field("lsd",val); SpielerInfo[playerid][pLSD] = strval(val);
mysql_fetch_field("kokain",val); SpielerInfo[playerid][pKokain] = strval(val);
mysql_fetch_field("helmid",val); SpielerInfo[playerid][pHelmID] = strval(val);
mysql_fetch_field("kmedizin",val); SpielerInfo[playerid][pKMedizin] = strval(val);
mysql_fetch_field("gmedizin",val); SpielerInfo[playerid][pGMedizin] = strval(val);
mysql_fetch_field("member",val); SpielerInfo[playerid][sMember] = strval(val);
if(SpielerInfo[playerid][sMember] == 19)
{
SpielerInfo[playerid][sMember] = 0;
SpielerInfo[playerid][pRank] = 0;
SCM(playerid,0xFF0000FF,"Terroristen gibt's nicht mehr!");
new queryxd[128];
format(queryxd, 128, "UPDATE `accounts` SET `member`='0',`rank`='0' WHERE `name`='%s'", SpielerInfo[playerid][Name]);
mysql_query(queryxd);
}
mysql_fetch_field("rank",val); SpielerInfo[playerid][pRank] = strval(val);
mysql_fetch_field("charakter",val); SpielerInfo[playerid][pChar] = strval(val);
mysql_fetch_field("contracttime",val); SpielerInfo[playerid][pContractTime] = strval(val);
mysql_fetch_field("health",val); SpielerInfo[playerid][pHealth] = floatstr(val);
mysql_fetch_field("interior",val); SpielerInfo[playerid][pInt] = strval(val);
mysql_fetch_field("local",val); SpielerInfo[playerid][pLocal] = strval(val);
mysql_fetch_field("team",val); SpielerInfo[playerid][pTeam] = strval(val);
mysql_fetch_field("pnumber",val); SpielerInfo[playerid][pPnumber] = strval(val);
mysql_fetch_field("housekey",val); SpielerInfo[playerid][pPhousekey] = strval(val);
mysql_fetch_field("bizzkey",val); SpielerInfo[playerid][pPbiskey] = strval(val);
mysql_fetch_field("carlic",val); SpielerInfo[playerid][pCarLic] = strval(val);
mysql_fetch_field("flylic",val); SpielerInfo[playerid][pFlyLic] = strval(val);
mysql_fetch_field("motolic",val); SpielerInfo[playerid][pMotoLic] = strval(val);
mysql_fetch_field("lkwlic",val); SpielerInfo[playerid][pLKWLic] = strval(val);
print("3");
mysql_fetch_field("ALG",val); SpielerInfo[playerid][pARG] = strval(val);
mysql_fetch_field("carinsurance",val); SpielerInfo[playerid][pCarInsurance] = strval(val);
mysql_fetch_field("lifeinsurance",val); SpielerInfo[playerid][pLifeInsurance] = strval(val);
mysql_fetch_field("boxmats",val); SpielerInfo[playerid][pBoxMats] = strval(val);
mysql_fetch_field("boxgras",val); SpielerInfo[playerid][pBoxGras] = strval(val);
mysql_fetch_field("boxlsd",val); SpielerInfo[playerid][pBoxLSD] = strval(val);
mysql_fetch_field("boxkokain",val); SpielerInfo[playerid][pBoxKokain] = strval(val);
mysql_fetch_field("boatlic",val); SpielerInfo[playerid][pBoatLic] = strval(val);
mysql_fetch_field("fishlic",val); SpielerInfo[playerid][pFishLic] = strval(val);
mysql_fetch_field("gunlic",val); SpielerInfo[playerid][pGunLic] = strval(val);
mysql_fetch_field("gun1",val); SpielerInfo[playerid][pGun1] = strval(val);
mysql_fetch_field("gun2",val); SpielerInfo[playerid][pGun2] = strval(val);
mysql_fetch_field("gun3",val); SpielerInfo[playerid][pGun3] = strval(val);
mysql_fetch_field("gun4",val); SpielerInfo[playerid][pGun4] = strval(val);
mysql_fetch_field("gun5",val); SpielerInfo[playerid][pGun5] = strval(val);
mysql_fetch_field("gun6",val); SpielerInfo[playerid][pGun6] = strval(val);
mysql_fetch_field("ammo1",val); SpielerInfo[playerid][pAmmo1] = strval(val);
mysql_fetch_field("ammo2",val); SpielerInfo[playerid][pAmmo2] = strval(val);
mysql_fetch_field("ammo3",val); SpielerInfo[playerid][pAmmo3] = strval(val);
mysql_fetch_field("ammo4",val); SpielerInfo[playerid][pAmmo4] = strval(val);
print("4");
mysql_fetch_field("ammo5",val); SpielerInfo[playerid][pAmmo5] = strval(val);
mysql_fetch_field("ammo6",val); SpielerInfo[playerid][pAmmo6] = strval(val);
mysql_fetch_field("payday",val); SpielerInfo[playerid][pPayDay] = strval(val);
mysql_fetch_field("paydayhad",val); SpielerInfo[playerid][pPayDayHad] = strval(val);
mysql_fetch_field("cdplayer",val); SpielerInfo[playerid][pCDPlayer] = strval(val);
mysql_fetch_field("wins",val); SpielerInfo[playerid][pWins] = strval(val);
mysql_fetch_field("loses",val); SpielerInfo[playerid][pLoses] = strval(val);
mysql_fetch_field("alcoholperk",val); SpielerInfo[playerid][pAlcoholPerk] = strval(val);
mysql_fetch_field("drugperk",val); SpielerInfo[playerid][pDrugPerk] = strval(val);
mysql_fetch_field("miserperk",val); SpielerInfo[playerid][pMiserPerk] = strval(val);
mysql_fetch_field("painperk",val); SpielerInfo[playerid][pPainPerk] = strval(val);
mysql_fetch_field("traderperk",val); SpielerInfo[playerid][pTraderPerk] = strval(val);
mysql_fetch_field("detskill",val); SpielerInfo[playerid][pDetSkill] = strval(val);
mysql_fetch_field("sexskill",val); SpielerInfo[playerid][pSexSkill] = strval(val);
mysql_fetch_field("boxskill",val); SpielerInfo[playerid][pBoxSkill] = strval(val);
mysql_fetch_field("lawskill",val); SpielerInfo[playerid][pLawSkill] = strval(val);
mysql_fetch_field("mechskill",val); SpielerInfo[playerid][pMechSkill] = strval(val);
mysql_fetch_field("jackskill",val); SpielerInfo[playerid][pJackSkill] = strval(val);
mysql_fetch_field("carskill",val); SpielerInfo[playerid][pCarSkill] = strval(val);
mysql_fetch_field("newsskill",val); SpielerInfo[playerid][pNewsSkill] = strval(val);
mysql_fetch_field("cockskill",val); SpielerInfo[playerid][pCookSkill] = strval(val);
mysql_fetch_field("fishskill",val); SpielerInfo[playerid][pFishSkill] = strval(val);
mysql_fetch_field("farmerskill",val); SpielerInfo[playerid][pFarmerSkill] = strval(val);
mysql_fetch_field("tut",val); SpielerInfo[playerid][pTut] = strval(val);
mysql_fetch_field("warns",val); SpielerInfo[playerid][pWarns] = strval(val);
print("5");
mysql_fetch_field("fuel",val); SpielerInfo[playerid][pFuel] = strval(val);
mysql_fetch_field("married",val); SpielerInfo[playerid][pMarried] = strval(val);
mysql_fetch_field("marriedto",val); SpielerInfo[playerid][pMarriedTo] = val;
mysql_fetch_field("kampfstil",val); SpielerInfo[playerid][pKampfstil] = strval(val);
mysql_fetch_field("spawnchange",val); SpielerInfo[playerid][pSpawnChange] = strval(val);
mysql_fetch_field("wanteds",val); SetPlayerWantedLevel(playerid, strval(val));
mysql_fetch_field("sflic",val); SpielerInfo[playerid][pSFLic] = strval(val);
mysql_fetch_field("lvlic",val); SpielerInfo[playerid][pLVLic] = strval(val);
mysql_fetch_field("uhrid",val); SpielerInfo[playerid][pUhrID] = strval(val);
mysql_fetch_field("ownperso",val); SpielerInfo[playerid][pOwnPerso] = strval(val);
mysql_fetch_field("pinb",val); SpielerInfo[playerid][pPinB] = strval(val);
mysql_fetch_field("handyid",val); SpielerInfo[playerid][pHandyID] = strval(val);
mysql_fetch_field("handyton",val); SpielerInfo[playerid][pHandyTon] = strval(val);
mysql_fetch_field("handyakku",val); SpielerInfo[playerid][pHandyAkku] = strval(val);
mysql_fetch_field("zigid",val); SpielerInfo[playerid][pZigID] = strval(val);
mysql_fetch_field("zig",val); SpielerInfo[playerid][pZig] = strval(val);
mysql_fetch_field("zigsucht",val); SpielerInfo[playerid][pZigSucht] = strval(val);
mysql_fetch_field("handygeld",val); SpielerInfo[playerid][pHandyGeld] = strval(val);
mysql_fetch_field("handyver",val); SpielerInfo[playerid][pHandyVer] = strval(val);
mysql_fetch_field("gwd",val); SpielerInfo[playerid][pGWD] = floatstr(val);
mysql_fetch_field("playminutes",val); SpielerInfo[playerid][pPlayMinutes] = strval(val);
mysql_fetch_field("gesamtminutes",val); SpielerInfo[playerid][pGesamtMinutes] = strval(val);
mysql_fetch_field("pfandflaschen",val); SpielerInfo[playerid][sPfandflaschen] = strval(val);
mysql_fetch_field("coins",val); SpielerInfo[playerid][pCoins] = strval(val);
mysql_fetch_field("tban",val); SpielerInfo[playerid][tban] = strval(val);
print("6");
mysql_free_result();
print("7");
if(SpielerInfo[playerid][pGebannt] == 1) {
SCM(playerid,COLOR_LIGHTRED,"Dein Account wurde Gebannt!");
Ban(playerid);
}
if(gettime() < SpielerInfo[playerid][tban]) {
SCM(playerid,COLOR_LIGHTRED,"Dein Account wurde Zeitgebannt!");
KickEx(playerid);
} else {
SpielerInfo[playerid][tban] = 0;
}
mysql_fetch_field("tottime",val); SpielerInfo[playerid][pTottime] = strval(val);
SetPlayerScore(playerid, SpielerInfo[playerid][pAge]);
if (SpielerInfo[playerid][pDonateRank] != 0)
{
new h[3];
if(gettime(h[0],h[1],h[2]) > SpielerInfo[playerid][pDonateRank])
{
SCM(playerid,COLOR_RED,"SERVER: Dein Premiumrang ist abgelaufen. Wir wünschen dir viel Spaß weiterhin!");
SpielerInfo[playerid][pDonateRank] = 0;
} else {
SCM(playerid, COLOR_WHITE,"SERVER: Du bist Premium User."); }
}
if (SpielerInfo[playerid][pAdmin] > 0)
{
new string2[53];
format(string2, sizeof(string2), "SERVER: Du hast dich als Level %d Admin eingeloggt.",SpielerInfo[playerid][pAdmin]);
SCM(playerid, COLOR_WHITE,string2);
}
SetSpawnInfo(playerid, SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pChar], 1770.6027,-1779.4812,13.5500, 1.0, -1, -1, -1, -1, -1, -1);
SpielerInfo[playerid][pOnline] = 1;
gPlayerLogged[playerid] = 1;
SaveMysqlPlayer(playerid);
SpawnPlayer(playerid);
SetPlayerWeapons(playerid);
DateProp(playerid);
}
else
{
format(string,sizeof(string),"Willkommen bei %s\n\nDein Passwort war nicht korrekt\nBitte Logge dich ein.",SERVERNAME);
ShowUserDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login",string,"Login","Abbrechen");
}
}
else
{
KickEx(playerid);
}
}