Код:
stock SavePlayer(playerid)
{
printf("x");
GetPlayerPos(playerid, CharacterData[playerid][pPosition][0], CharacterData[playerid][pPosition][1], CharacterData[playerid][pPosition][2]);
GetPlayerFacingAngle(playerid, CharacterData[playerid][pPosition][3]);
CharacterData[playerid][pInt] = GetPlayerInterior(playerid);
CharacterData[playerid][pVW] = GetPlayerVirtualWorld(playerid);
printf("Deboeg");
GetPlayerHealth(playerid, CharacterData[playerid][pHealth]);
GetPlayerArmour(playerid, CharacterData[playerid][pArmor]);
printf("Deboeg");
SaveContacts(playerid);
SavePlayerWeapons(playerid);
for(new toyID = 1; toyID < MAX_TOYS; toyID++)
{
if(ToyData[toyID][toy_Owner] == CharacterData[playerid][pSQLID])
{
SaveToy(toyID);
}
else
{
continue;
}
}
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `characters` SET `ip` = '%e', `gender` = '%d', `age` = '%d', `positionx` = '%f', `positiony` = '%f', `positionz` = '%f', `positiona` = '%f'", CharacterData[playerid][pIP], CharacterData[playerid][pGender], CharacterData[playerid][pAge], CharacterData[playerid][pPosition][0], CharacterData[playerid][pPosition][1], CharacterData[playerid][pPosition][2], CharacterData[playerid][pPosition][3]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `adminlevel` = '%d', `cash` = '%d', `virtualworld` = '%d', `interior` = '%d', `registerdate` = '%e', `lastlogin` = '%e', `ammo1` = '%d'", szQuery, CharacterData[playerid][pAdmin], CharacterData[playerid][pCash], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), CharacterData[playerid][pRegisterDate], CharacterData[playerid][pLastLogin], CharacterData[playerid][pAmmo][1]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `houseID` = '%d', `factionID` = '%d', `rank` = '%d', `jobID` = '%d', `materials` = '%d', `Cocaine` = '%d', `pot` = '%d', `skin` = '%d'",szQuery, CharacterData[playerid][pHouseID], CharacterData[playerid][pFaction], CharacterData[playerid][pRank], CharacterData[playerid][pJob], CharacterData[playerid][pMaterials], CharacterData[playerid][pCocaine], CharacterData[playerid][pPot], CharacterData[playerid][pSkin]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `phonenumber` = '%d', `phone` = '%d', `level` = '%d', `respects` = '%d', `paycheck` = '%d', `bizID` = '%d'", szQuery, CharacterData[playerid][pPhoneNumber], CharacterData[playerid][pPhone], CharacterData[playerid][pLevel], CharacterData[playerid][pRespects], CharacterData[playerid][pPayCheck], CharacterData[playerid][pBizID]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `boatlicense` = '%d', `bikelicense` = '%d', `carlicense` = '%d', `planelicense` = '%d', `developer` = '%d', `betatester` = '%d', `playinghours` = '%d'", szQuery, CharacterData[playerid][pBoatLicense], CharacterData[playerid][pBikeLicense], CharacterData[playerid][pCarLicense], CharacterData[playerid][pPlaneLicense], CharacterData[playerid][pDev], CharacterData[playerid][pBetaTester], CharacterData[playerid][pPlayingHours]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `weapon0` = '%d', `weapon1` = '%d', `weapon2` = '%d', `weapon3` = '%d', `weapon4` = '%d', `weapon5` = '%d', `weapon6` = '%d'", szQuery, CharacterData[playerid][pWeapon][0], CharacterData[playerid][pWeapon][1], CharacterData[playerid][pWeapon][2], CharacterData[playerid][pWeapon][3], CharacterData[playerid][pWeapon][4], CharacterData[playerid][pWeapon][5], CharacterData[playerid][pWeapon][6]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `weapon7` = '%d', `weapon8` = '%d', `weapon9` = '%d', `weapon10` = '%d', `weapon11` = '%d', `weapon12` = '%d', `ammo0` = '%d', `insidebiz` = '%d', `totalfine` = '%d'",
szQuery, CharacterData[playerid][pWeapon][7], CharacterData[playerid][pWeapon][8], CharacterData[playerid][pWeapon][9], CharacterData[playerid][pWeapon][10], CharacterData[playerid][pWeapon][11], CharacterData[playerid][pWeapon][12], CharacterData[playerid][pAmmo][0], CharacterData[playerid][pInsideBiz], CharacterData[playerid][pTotalFine]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `ammo2` = '%d', `ammo3` = '%d', `ammo4` = '%d', `ammo5` = '%d', `ammo6` = '%d', `ammo7` = '%d', `ammo8` = '%d', `ammo9` = '%d', `insidehouse` = '%d'"
, szQuery, CharacterData[playerid][pAmmo][2], CharacterData[playerid][pAmmo][3], CharacterData[playerid][pAmmo][4], CharacterData[playerid][pAmmo][5], CharacterData[playerid][pAmmo][6], CharacterData[playerid][pAmmo][7], CharacterData[playerid][pAmmo][8], CharacterData[playerid][pAmmo][9], CharacterData[playerid][pInsideHouse]);
// From here
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `ammo10` = '%d', `ammo11` = '%d', `ammo12` = '%d', `health` = '%f', `armor` = '%f', `wanted` = '%i'", szQuery, CharacterData[playerid][pAmmo][10], CharacterData[playerid][pAmmo][11], CharacterData[playerid][pAmmo][12], CharacterData[playerid][pHealth], CharacterData[playerid][pArmor], CharacterData[playerid][pWanted]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `warrant1` = '%e', `warrant2` = '%e', `warrant3` = '%e', `warrant4` = '%e', `warrant5` = '%e', `warrant6` = '%e'", szQuery, CharacterData[playerid][pWarrant1], CharacterData[playerid][pWarrant2], CharacterData[playerid][pWarrant3], CharacterData[playerid][pWarrant4], CharacterData[playerid][pWarrant5], CharacterData[playerid][pWarrant6]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `prisoned` = '%d', `prisontime` = '%d', `banned` = '%i', `banreason` = '%e', `bannedby` = '%e', `bandate` = '%e', `banstamp` = '%d'", szQuery, CharacterData[playerid][pPrisoned], CharacterData[playerid][pPrisonTime], CharacterData[playerid][pBanned], CharacterData[playerid][pBanReason], CharacterData[playerid][pBannedBy], CharacterData[playerid][pBanDate], CharacterData[playerid][pBanStamp]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `hospitalized` = '%d', `autologin` = '%d', `musicstream` = '%d', `helper` = '%d', `stealth` = '%d', `newbietog` = '%d'", szQuery, CharacterData[playerid][pHospitalized], CharacterData[playerid][pAutoLogin], CharacterData[playerid][pMusicStreaming], CharacterData[playerid][pHelper], CharacterData[playerid][pStealth], CharacterData[playerid][pNewbieToggled]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `banappealer` = '%d', `factionmanager` = '%d', `familymanager` = '%d', `housemanager` = '%d', `bannedplayers` = '%d', `kickedplayers` = '%d'", szQuery, CharacterData[playerid][pBanAppealer], CharacterData[playerid][pFactionManager], CharacterData[playerid][pFamilyManager], CharacterData[playerid][pHouseManager], CharacterData[playerid][pBannedPlayers], CharacterData[playerid][pKickedPlayers]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `leader` = '%d', `facduty` = '%d', `bank` = '%d', `family` = '%i', `boughtvehicle` = '%d', `bounty` = '%d', `lighters` = '%d' WHERE `userID` = '%d'", szQuery, CharacterData[playerid][pLeader], CharacterData[playerid][pFacDuty], CharacterData[playerid][pBank], CharacterData[playerid][pFamily], CharacterData[playerid][pGotVehicle], CharacterData[playerid][pBounty], CharacterData[playerid][pLighters], CharacterData[playerid][pSQLID]);
mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "UPDATE `characters` SET `failedhits` = '%d', `completedhits` = '%d', `username` = '%e', `prisonedBy` = '%e', `prisonReason` = '%e', `blindfolds` = '%d', `ciggerettes` = '%d'", CharacterData[playerid][pFailedHits], CharacterData[playerid][pCompletedHits], CharacterData[playerid][pUsername], CharacterData[playerid][pPrisonedBy], CharacterData[playerid][pPrisonReason], CharacterData[playerid][pBlindFolds],
CharacterData[playerid][pCiggerettes]);
printf("Debug: %s", CharacterData[playerid][pUsername]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `hungrylevel` = '%d', `dealerID` = '%d', `phonebook` = '%d', `adressbook` = '%d', `ties` = '%d', `paycheckamount` = '%d', `armsdealerskill` = '%d', `newbietag` = '%d'", szQuery, CharacterData[playerid][pHungryLevel], CharacterData[playerid][pDealerID], CharacterData[playerid][pPhoneBook], CharacterData[playerid][pAdressBook], CharacterData[playerid][pTies],
CharacterData[playerid][pPayCheckAmount], CharacterData[playerid][pArmsDealerSkill], CharacterData[playerid][pNewbieTag]);
mysql_format(MainPipeline, szQuery, sizeof(szQuery), "%s, `baking` = '%d', `nitro` = '%d' WHERE `userID` = '%d'", szQuery, CharacterData[playerid][pBakingPowder], CharacterData[playerid][pNitroxide], CharacterData[playerid][pSQLID]);
return mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);
}
// ----- [ STOCK FUNCTIONS ] -----