pawn Code:
stock SaveAcc(playerid) {
if(!IsPlayerConnected(playerid)) return 0;
if(!gPlayerLogged[playerid] && !GetPVarInt(playerid, "reg")) return 0;
DeletePVar(playerid, "reg");
new f_query[1024], f_str[128];
format(f_query, sizeof(f_query), "UPDATE `"TABLE_ACCOUNTS"` SET ");
format(f_str, sizeof(f_str), "`Nickname`='%s'",sendernames(playerid)); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Password`='%s'",gPassword[playerid]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Passwordip`='%s'",gPasswordip[playerid]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Level`=%i",PlayerInfo[playerid][pLevel]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`House`=%i",PlayerInfo[playerid][pPhousekey]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Bizz`=%i",PlayerInfo[playerid][pPbiskey]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`AdminLevel`=%i",PlayerInfo[playerid][pAdmin]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Fuelcar`=%f",PlayerInfo[playerid][pFuelcar]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Text`=%i",PlayerInfo[playerid][pText]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`HP`=%f",PlayerInfo[playerid][pHP]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pPhoneBook`=%i",PlayerInfo[playerid][pPhoneBook]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pDirectory`=%i",PlayerInfo[playerid][pDirectory]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Car`=%i",PlayerInfo[playerid][pCasr]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Donatesches`=%i",PlayerInfo[playerid][pDonateches]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Donatemoney`=%i",PlayerInfo[playerid][pDonatemoney]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`DonateRank`=%i",PlayerInfo[playerid][pDonateRank]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Registered`=%i",PlayerInfo[playerid][pReg]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Sex`=%i",PlayerInfo[playerid][pSex]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Muted`=%i",PlayerInfo[playerid][pMuted]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Respect`=%i",PlayerInfo[playerid][pExp]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Money`=%i",PlayerInfo[playerid][pCashs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Paycheck`=%i",PlayerInfo[playerid][pPayCheck]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Jailed`=%i",PlayerInfo[playerid][pJailed]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`JailTime`=%i",PlayerInfo[playerid][pJailTime]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Materials`=%i",PlayerInfo[playerid][pMats]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Minx`=%i",PlayerInfo[playerid][pMinx]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Zp`=%i",PlayerInfo[playerid][pZp]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`SDPistol`=%i",PlayerInfo[playerid][pSDPistol]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`DesertEagle`=%i",PlayerInfo[playerid][pDesertEagle]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`ShotGun`=%i",PlayerInfo[playerid][pShotGun]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`MP5`=%i",PlayerInfo[playerid][pMP5]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`AK47`=%i",PlayerInfo[playerid][pAK47]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`M4`=%i",PlayerInfo[playerid][pM4]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pFs`=%i",PlayerInfo[playerid][pFs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pLs`=%i",PlayerInfo[playerid][pLs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pGs`=%i",PlayerInfo[playerid][pGs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pBs`=%i",PlayerInfo[playerid][pBs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pDs`=%i",PlayerInfo[playerid][pDs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pAs`=%i",PlayerInfo[playerid][pAs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Drugs`=%i",PlayerInfo[playerid][pDrugs]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Leader`=%i",PlayerInfo[playerid][pLeader]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Member`=%i",PlayerInfo[playerid][pMember]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Rank`=%i",PlayerInfo[playerid][pRank]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Job`=%i",PlayerInfo[playerid][pJob]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`VodPrava`=%i",PlayerInfo[playerid][pVodPrava]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`BizLic`=%i",PlayerInfo[playerid][pBizLic]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`FlyLic`=%i",PlayerInfo[playerid][pFlyLic]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`BoatLic`=%i",PlayerInfo[playerid][pBoatLic]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`FishLic`=%i",PlayerInfo[playerid][pFishLic]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`GunLic`=%i",PlayerInfo[playerid][pGunLic]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Slot2`=%i",PlayerInfo[playerid][pSlot2]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Slot3`=%i",PlayerInfo[playerid][pSlot3]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Slot4`=%i",PlayerInfo[playerid][pSlot4]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Slot5`=%i",PlayerInfo[playerid][pSlot5]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Slot6`=%i",PlayerInfo[playerid][pSlot6]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ammo2`=%i",PlayerInfo[playerid][pAmmo2]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ammo3`=%i",PlayerInfo[playerid][pAmmo3]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ammo4`=%i",PlayerInfo[playerid][pAmmo4]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ammo5`=%i",PlayerInfo[playerid][pAmmo5]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ammo6`=%i",PlayerInfo[playerid][pAmmo6]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), " WHERE `ID` = %i", PlayerInfo[playerid][pID]); strcat(f_query, f_str);
if(!mysql_query(f_query)) return 0;
format(f_query, sizeof(f_query), "UPDATE `"TABLE_ACCOUNTS"` SET ");
format(f_str, sizeof(f_str), "`Char`=%i",PlayerInfo[playerid][pChar]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Char1`=%i",PlayerInfo[playerid][pChar1]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Char2`=%i",PlayerInfo[playerid][pChar2]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Chars`=%i",PlayerInfo[playerid][pChars]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Int`=%i",PlayerInfo[playerid][pInt]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Local`=%i",PlayerInfo[playerid][pLocal]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Model`=%i",PlayerInfo[playerid][pModel]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`PhoneNr`=%i",PlayerInfo[playerid][pPnumber]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`PayDay`=%i",PlayerInfo[playerid][pPayDay]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Warnings`=%i",PlayerInfo[playerid][pWarns]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`unWarnstime`=%i",PlayerInfo[playerid][punWarnstime]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Fuel`=%i",PlayerInfo[playerid][pFuel]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pRepair`=%i",PlayerInfo[playerid][pRepair]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Married`=%i",PlayerInfo[playerid][pMarried]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pMaxst`=%i",PlayerInfo[playerid][pMaxst]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`MuteTime`=%i",PlayerInfo[playerid][pMuteTime]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Bank`=%i",PlayerInfo[playerid][pBank]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Tazer`=%i",PlayerInfo[playerid][pTazer]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`BoxSkill`=%i",PlayerInfo[playerid][pBoxSkill]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`KongfuSkill`=%i",PlayerInfo[playerid][pKongfuSkill]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`KickboxSkill`=%i",PlayerInfo[playerid][pKickboxSkill]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Keys`=%i",PlayerInfo[playerid][pKeys]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Zakonop`=%i",PlayerInfo[playerid][pZakonp]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`NarcoZavisimost`=%i",PlayerInfo[playerid][pNarcoZavisimost]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`NarcoLomka`=%i",PlayerInfo[playerid][pNarcoLomka]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Proz`=%i",PlayerInfo[playerid][pProz]); strcat(f_query, f_str);
for(new x; x < 14; x ++) {
format(f_str, sizeof(f_str), ",`pComp%i`=%i", x, vComponents[playerid][x]);
strcat(f_query, f_str);
}
format(f_str, sizeof(f_str), ",`pCvet`=%i",PlayerInfo[playerid][pCvet]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pCvet2`=%i",PlayerInfo[playerid][pCvet2]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pCvet3`=%i",PlayerInfo[playerid][pCvet3]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pMestoJail`=%i",PlayerInfo[playerid][pMestoJail]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pZvezdi`=%i",PlayerInfo[playerid][pZvezdi]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`WantedDeaths`=%i",PlayerInfo[playerid][pWantedDeaths]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Ogran`=%i",PlayerInfo[playerid][pOgran]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pBkey`=%i",PlayerInfo[playerid][pBkey]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pVipo`=%i",PlayerInfo[playerid][pVipo]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pRepa`=%i",PlayerInfo[playerid][pRepa]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`send`=%i",PlayerInfo[playerid][send]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`Tutorial`=%i",PlayerInfo[playerid][pTut]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pKeyipstats`=%i",PlayerInfo[playerid][pKeyipstats]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), ",`pEmailstats`=%i",PlayerInfo[playerid][pEmailstats]); strcat(f_query, f_str);
format(f_str, sizeof(f_str), " WHERE `ID` = %i", PlayerInfo[playerid][pID]); strcat(f_query, f_str);
if(!mysql_query(f_query)) return 0;
return 1;
}