18.08.2014, 13:50
PHP код:
SaveAccount(playerid)
{
if (gPlayerLogged[playerid] == false) return true;
new src[1024], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
format(query,sizeof(query),"UPDATE "TABLE_ACCOUNT" SET ");
format(src,sizeof(src)," `Brunt` = '%i',",PlayerInfo[playerid][pBrunt]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `EnterHour` = '%i',",PlayerInfo[playerid][pEnterHour]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `CrimeWho` = '%s',",PlayerInfo[playerid][pCrimeWho]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Crime` = '%s',",PlayerInfo[playerid][pCrime]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `NewlyWeds` = '%i',",PlayerInfo[playerid][pNewlyWeds]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `NewlyWedsTo` = '%s',",PlayerInfo[playerid][pNewlyWedsTo]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Jerrycan` = '%i',",PlayerInfo[playerid][pJerrycan]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Tools` = '%i',",PlayerInfo[playerid][pTools]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `JailTime` = '%i',",PlayerInfo[playerid][pJailTime]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `WantedLevel` = '%i',",PlayerInfo[playerid][pWantedLevel]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Mats` = '%i',",PlayerInfo[playerid][pMats]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Drugs` = '%i',",PlayerInfo[playerid][pDrugs]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `WarnTime` = '%i',",PlayerInfo[playerid][pWarnTime]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Warn` = '%i',",PlayerInfo[playerid][pWarn]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Mute` = '%i',",PlayerInfo[playerid][pMute]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `MuteReport` = '%i',",PlayerInfo[playerid][pMuteReport]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `MobileCash` = '%i',",PlayerInfo[playerid][pMobilecash]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Number` = '%i',",PlayerInfo[playerid][pNumberPhone]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Bank` = '%i',",PlayerInfo[playerid][pBank]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Money` = '%i',",PlayerInfo[playerid][pCash]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `FracSkin` = '%i',",PlayerInfo[playerid][pSkin]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Rang` = '%i',",PlayerInfo[playerid][pRang]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Leader` = '%i',",PlayerInfo[playerid][pLeader]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Member` = '%i',",PlayerInfo[playerid][pMember]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `AdminPass` = '%s',",PlayerInfo[playerid][pAdminPassword]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Admin` = '%i',",PlayerInfo[playerid][pAdmin]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Job` = '%i',",PlayerInfo[playerid][pJob]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Sex` = '%i',",PlayerInfo[playerid][pSex]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Health` = '%f',",PlayerInfo[playerid][pHealth]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Level` = '%i',",PlayerInfo[playerid][pLevel]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Exp` = '%i',",PlayerInfo[playerid][pExp]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Char` = '%i',",PlayerInfo[playerid][pChar]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Check` = '%i',",PlayerInfo[playerid][pCheck]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Donate` = '%i',",PlayerInfo[playerid][pScrDonate]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `ExpTime` = '%i',",PlayerInfo[playerid][pExpTime]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `HourFraction` = '%i',",PlayerInfo[playerid][pHourFractions]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Reputation` = '%i',",PlayerInfo[playerid][pReputation]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Dependence` = '%i',",PlayerInfo[playerid][pDepen]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Dolg` = '%i',",PlayerInfo[playerid][pDolg]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `UseKrisha` = '%i',",PlayerInfo[playerid][pUseKrisha]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Krisha` = '%i',",PlayerInfo[playerid][pKrisha]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Eat` = '%i',",PlayerInfo[playerid][pEat]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Vip` = '%i',",PlayerInfo[playerid][pStatusVip]);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," `Escape` = '%i',",PlayerInfo[playerid][pEscape]);
strcat(query,src,sizeof(query));
format(PlayerInfo[playerid][pLics],40,"%d,%d,%d,%d",PlayerInfo[playerid][pLic][0],PlayerInfo[playerid][pLic][1],PlayerInfo[playerid][pLic][2],PlayerInfo[playerid][pLic][3]);
format(src,sizeof(src)," `Lics` = '%s',",PlayerInfo[playerid][pLics]);
strcat(query,src,sizeof(query));
new notice[8];
format(notice,sizeof(notice),"%d,%d,%d",PlayerInfo[playerid][pNotice][0],PlayerInfo[playerid][pNotice][1],PlayerInfo[playerid][pNotice][2]);
format(src,sizeof(src)," `Notice` = '%s',",notice);
strcat(query,src,sizeof(query));
format(PlayerInfo[playerid][pTogs],40,"%d,%d,%d",PlayerInfo[playerid][pTog][0],PlayerInfo[playerid][pTog][1],PlayerInfo[playerid][pTog][2]);
format(src,sizeof(src)," `Togs` = '%s',",PlayerInfo[playerid][pTogs]);
strcat(query,src,sizeof(query));
format(PlayerInfo[playerid][pJails],40,"%d,%d,%d",PlayerInfo[playerid][pJail][0],PlayerInfo[playerid][pJail][1],PlayerInfo[playerid][pJail][2]);
format(src,sizeof(src)," `Jails` = '%s',",PlayerInfo[playerid][pJails]);
strcat(query,src,sizeof(query));
new gunskill[30];
format(gunskill,sizeof(gunskill),"%d,%d,%d,%d,%d,%d",PlayerInfo[playerid][pGunSkill][0],PlayerInfo[playerid][pGunSkill][1],PlayerInfo[playerid][pGunSkill][2],
PlayerInfo[playerid][pGunSkill][3],PlayerInfo[playerid][pGunSkill][4],PlayerInfo[playerid][pGunSkill][5]);
format(src,sizeof(src)," `Skills` = '%s'",gunskill);
strcat(query,src,sizeof(query));
format(src,sizeof(src)," WHERE `Name` = '%s'",name);
strcat(query,src,sizeof(query));
mysql_query(query);
new guns[56], ammo[56];
format(guns,56,"%i, %i, %i, %i, %i", CarInfo[playerid][cGun][0],CarInfo[playerid][cGun][1],CarInfo[playerid][cGun][2],CarInfo[playerid][cGun][3],CarInfo[playerid][cGun][4]);
format(ammo,56,"%i, %i, %i, %i, %i", CarInfo[playerid][cGunAmmo][0],CarInfo[playerid][cGunAmmo][1],CarInfo[playerid][cGunAmmo][2],CarInfo[playerid][cGunAmmo][3],CarInfo[playerid][cGunAmmo][4]);
format(CarInfo[playerid][cColors],16,"%d,%d", CarInfo[playerid][cColor][0], CarInfo[playerid][cColor][1]);
format(query,sizeof(query),"UPDATE "TABLE_CARS" SET `Colors` = '%s', `Model` = '%i', `Cost` = '%i', `Guns` = '%s', `Ammo` = '%s', `Drugs` = '%i', `Wheel` = '%i', `Nitro` = '%i', `FBumber` = '%i', `RBumber` = '%i', `Spoiler` = '%i', `Hydra` = '%i' WHERE `Owner` = '%s'",
CarInfo[playerid][cColors],CarInfo[playerid][cModel],CarInfo[playerid][cCost],guns,ammo,CarInfo[playerid][cDrugs],CarInfo[playerid][cWheel],CarInfo[playerid][cNitro],CarInfo[playerid][cFBumber],CarInfo[playerid][cRBumber],CarInfo[playerid][cSpoiler],CarInfo[playerid][cHydra],name);
mysql_query(query);
return true;
}