25.06.2015, 22:00
what's wrong with it?
PHP код:
forward OnPlayerSave(playerid);
public OnPlayerSave(playerid)
{
new query[500];
if(IsLoggedIn[playerid] == 1 && playerid != INVALID_PLAYER_ID && !IsPlayerNPC(playerid))
{
strcat(query, "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `Deaths`=%d, `Kills`=%d, `HitsCompleted`=%d, `SkinID`=%d, `Robbed`=%d, `RobbedMoney`=%d, `GotRobbed`=%d, `GotRobbedMoney`=%d, `StoreRobbed`=%d, `StoreRobbedMoney`=%d, `FoodPurchased`=%d, `FoodPurchasedMoney`=%d, `WeaponsPurchased`=%d, `WeaponsPurchasedMoney`=%d, `Healed`=%d, `Arrest`=%d, `Busted`=%d,");
strcat(query, "`Crimes`=%d, `WantedLevel`=%d, `Medical`=%d WHERE `ID`=%d AND `user`='%e'",);
pInfo[playerid][pAdmin], pInfo[playerid][pVip], GetPlayerMoney(playerid), GetPlayerScore(playerid), pInfo[playerid][pDeaths], pInfo[playerid][pKills],
pInfo[playerid][pHitsCompleted], GetPlayerSkin(playerid), pInfo[playerid][pRobbed], pInfo[playerid][pRobbedMoney], pInfo[playerid][pGotRobbed], pInfo[playerid][pGotRobbedMoney],
pInfo[playerid][pStoreRobbed], pInfo[playerid][pStoreRobbedMoney], pInfo[playerid][pFoodPurchased], pInfo[playerid][pFoodPurchasedMoney],
pInfo[playerid][pWeaponsPurchased], pInfo[playerid][pWeaponsPurchasedMoney], pInfo[playerid][pHealed], pInfo[playerid][pArrest],
pInfo[playerid][pBusted], pInfo[playerid][pCrimes], pInfo[playerid][pWantedLevel], pInfo[playerid][pMedical],
pInfo[playerid][pID], PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
print(query);
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `IsBanned`=%d WHERE `ID`=%d AND user='%e'", pInfo[playerid][pIsBanned], PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
IsLoggedIn[playerid] = 0;
if(pInfo[playerid][pAdmin] >= 1)
{
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `AdminName`=%s WHERE `ID`=%d AND `user`='%e'", pInfo[playerid][pAName]);
return true;
}
}
return 1;
}