Well I don't know what is happening with my server, but there is command "update" I've made, and sometimes it works some times it crashes server.
function. And there for here is my
function.
pawn Код:
stock SavePlayerStats(playerid){
new SaveQuery[1024];
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `DisplayName` = '%s', `Password` = '%s', `Gender` = %d, `Age` = %d, `Skin` = %d, `Level` = %d, `Points` = %d WHERE `ID` = %d", PlayerInfos[playerid][pDisplayName], PlayerInfos[playerid][pPassword], PlayerInfos[playerid][pGender], PlayerInfos[playerid][pAge], PlayerInfos[playerid][pSkin], PlayerInfos[playerid][pLevel], PlayerInfos[playerid][pPoints], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Banned` = %d, `Bans` = %d, `Kicks` = %d, `Mask` = %d, `HasMask` = %d, `Administrator` = %d, `Helper` = %d, `Donator` = %d WHERE `ID` = %d", PlayerInfos[playerid][pBanned], PlayerInfos[playerid][pBans], PlayerInfos[playerid][pKicks], PlayerInfos[playerid][pMask], PlayerInfos[playerid][pHasMask], PlayerInfos[playerid][pAdministrator], PlayerInfos[playerid][pHelper], PlayerInfos[playerid][pDonator], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Money` = %d, `Bank` = %d, `Spawn_X` = %f, `Spawn_Y` = %f, `Spawn_Z` = %f, `Interior` = %d, `VirtualWorld` = %d, `Crashed` = %d WHERE `ID` = %d", PlayerInfos[playerid][pMoney], PlayerInfos[playerid][pBank], PlayerInfos[playerid][pSpawnX], PlayerInfos[playerid][pSpawnY], PlayerInfos[playerid][pSpawnZ], PlayerInfos[playerid][pInt], PlayerInfos[playerid][pVirtualWorld], PlayerInfos[playerid][pCrashed], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `HouseKey` = %d, `BusinessKey` = %d, `Faction` = %d, `Rank` = %d, `Leader` = %d, `Job` = %d WHERE `ID` = %d", PlayerInfos[playerid][pHouseKey], PlayerInfos[playerid][pBusinessKey], PlayerInfos[playerid][pFaction], PlayerInfos[playerid][pRank], PlayerInfos[playerid][pLeader], PlayerInfos[playerid][pJob], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `ContractTime` = %d, `Food` = %d, `Down` = %d, `DownX` = %f, `DownY` = %f, `DownZ` = %f, `DownInt` = %d, `DownViwo` = %d WHERE `ID` = %d", PlayerInfos[playerid][pContractTime], PlayerInfos[playerid][pFood], PlayerInfos[playerid][pDown], PlayerInfos[playerid][pDownX], PlayerInfos[playerid][pDownY], PlayerInfos[playerid][pDownZ], PlayerInfos[playerid][pDownInt], PlayerInfos[playerid][pDownViwo], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Health` = %f, `Armour` = %f, `PayDay` = %d, `PayDayMoney` = %d, `Suspect` = %d, `PrisonTime` = %d WHERE `ID` = %d", PlayerInfos[playerid][pHealth], PlayerInfos[playerid][pArmour], PlayerInfos[playerid][pPayDay], PlayerInfos[playerid][pPayDayMoney], PlayerInfos[playerid][pSuspect], PlayerInfos[playerid][pPrisonTime], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `MobileModel` = %d, `MobileNumber` = %d, `MobileMoney` = %d, `BuildMaterial` = %d, `RepairMaterial` = %d WHERE `ID` = %d", PlayerInfos[playerid][pMobileModel], PlayerInfos[playerid][pMobileNumber], PlayerInfos[playerid][pMobileMoney], PlayerInfos[playerid][pBuildMaterials], PlayerInfos[playerid][pRepairMaterials], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Insurance` = %d, `HouseRentKey` = %d, `CarKey` = %d, `Rope` = %d, `Cigaretes` = %d, `Lighter` = %d, `Bat` = %d WHERE `ID` = %d", PlayerInfos[playerid][pInsurance], PlayerInfos[playerid][pHouseRentKey], PlayerInfos[playerid][pCarKey], PlayerInfos[playerid][pRope], PlayerInfos[playerid][pCigaretes], PlayerInfos[playerid][pLighter], PlayerInfos[playerid][pBat], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Helmet` = %d, `FishRod` = %d, `FishHook` = %d, `FishBait` = %d, `ToolKit` = %d, `Token` = %d, `Watch` = %d, `Fish` = %d WHERE `ID` = %d", PlayerInfos[playerid][pHelmet], PlayerInfos[playerid][pFishRod], PlayerInfos[playerid][pFishHook], PlayerInfos[playerid][pFishBait], PlayerInfos[playerid][pToolKit], PlayerInfos[playerid][pToken], PlayerInfos[playerid][pWatch], PlayerInfos[playerid][pFish], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Language` = %d, `Materials` = %d, `Fines` = %d, `Hunger` = %f , `RoomKey` = %d, `Rip` = %d WHERE `ID` = %d", PlayerInfos[playerid][pLanguage], PlayerInfos[playerid][pMaterials], PlayerInfos[playerid][pFines], PlayerInfos[playerid][pHunger], PlayerInfos[playerid][pRoomKey], PlayerInfos[playerid][pRip], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `DrivingLic` = %d, `FlyingLic` = %d, `WeaponLic` = %d, `BoatLic` = %d, `Radio` = %d, `RadioFerq` = %d, `BankCredit` = %d WHERE `ID` = %d;", PlayerInfos[playerid][pDrivingLic], PlayerInfos[playerid][pFlyingLic], PlayerInfos[playerid][pWeapLic], PlayerInfos[playerid][pBoatLic], PlayerInfos[playerid][pRadio], PlayerInfos[playerid][pRadioFreq], PlayerInfos[playerid][pBankCredit], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Strength` = %f, `Bomb` = %d, `SpawnID` = %d, `Hair` = %d, `Energy` = %d, `Dirty` = %d WHERE `ID` =%d;", PlayerInfos[playerid][pStrength], PlayerInfos[playerid][pBomb], PlayerInfos[playerid][pSpawn], PlayerInfos[playerid][pHair], PlayerInfos[playerid][pEnergy], PlayerInfos[playerid][pDirty], PlayerInfos[playerid][pSQLID]);
if(!mysql_query(SaveQuery)) StatsSaving[playerid] = true;
format(SaveQuery, sizeof(SaveQuery), "UPDATE "TABLE_PLAYERS" SET `Pissed` = %d WHERE `ID` =%d;", PlayerInfos[playerid][pPissed], PlayerInfos[playerid][pSQLID]);
mysql_query(SaveQuery, SAVE_PLAYER_QUERY, playerid);
return true;
}