SQL SAVing
#1

what's wrong with it?

PHP код:
forward OnPlayerSave(playerid);
public 
OnPlayerSave(playerid)
{
    new 
query[500];
    if(
IsLoggedIn[playerid] == && 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(MySQLConquery"""");
        print(
query);
        
mysql_format(MySQLConquerysizeof(query), "UPDATE `players` SET `IsBanned`=%d WHERE `ID`=%d AND user='%e'"pInfo[playerid][pIsBanned], PlayerName(playerid));
        
mysql_tquery(MySQLConquery"""");
        
IsLoggedIn[playerid] = 0;
        if(
pInfo[playerid][pAdmin] >= 1)
        {
            
mysql_format(MySQLConquerysizeof(query), "UPDATE `players` SET `AdminName`=%s WHERE `ID`=%d AND `user`='%e'"pInfo[playerid][pAName]);
            return 
true;
        }
    }
    return 
1;

Reply


Messages In This Thread
SQL SAVing - by STONEGOLD - 25.06.2015, 22:00
Re: SQL SAVing - by STONEGOLD - 25.06.2015, 22:07
Re: SQL SAVing - by Stanford - 25.06.2015, 22:08
Re: SQL SAVing - by STONEGOLD - 25.06.2015, 22:10
Re: SQL SAVing - by STONEGOLD - 25.06.2015, 23:28
Re: SQL SAVing - by STONEGOLD - 26.06.2015, 08:59
Re: SQL SAVing - by J0sh... - 26.06.2015, 09:48
Re: SQL SAVing - by STONEGOLD - 26.06.2015, 09:54
Re: SQL SAVing - by STONEGOLD - 26.06.2015, 10:10
Re: SQL SAVing - by Prokill911 - 26.06.2015, 12:16

Forum Jump:


Users browsing this thread: 1 Guest(s)