MySQL doesn't save
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Then check if they are!
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(Logged[playerid] == 1)
    {
        new query[512], Float:sHealth, Float:sArmor, Float:sX, Float:sY, Float:sZ, Float:sA;
       
        GetPlayerHealth(playerid, sHealth);
        GetPlayerArmour(playerid, sArmor);
        GetPlayerPos(playerid, sX, sY, sZ);
        GetPlayerFacingAngle(playerid, sA);
       
        format(query, sizeof(query), "UPDATE players SET Health = %.1f, Armor = %.1f, Interior = %i, VW = %i, Skin = %i, X = %.1f, Y = %.1f, Z = %.1f, A = %.1f WHERE Name = '%s'", sHealth, sArmor, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), GetPlayerSkin(playerid), sX, sY, sZ, sA, gName);
        mysql_function_query(IMDb, query, false, "", "");
    }
    return 1;
}
By the way, if it doesn't save either then you need to make sure for 2 things. That the player is actually logged in (Logged[playerid] is 1) and that the fields name are correct written or exist. You can make sure about that by running the query to phpMyAdmin.
Actually this works, and there is the print:
Код:
UPDATE players SET `Health` = 100.0, `Armor` = 0.0, `Interior` = 0, `VW` = 0, `Skin` = 0, `X` = 1958.3, `Y` = 1343.1, `Z` = 15.3, `A` = 269.1 WHERE `Name` = 'Ryder_Ballaz'
So it now saves, thank you! REP+
Reply


Messages In This Thread
MySQL doesn't save - by x96664 - 26.09.2013, 08:38
Re: MySQL doesn't save - by Konstantinos - 26.09.2013, 10:06
Re: MySQL doesn't save - by zT KiNgKoNg - 26.09.2013, 10:10
Re: MySQL doesn't save - by Konstantinos - 26.09.2013, 10:12
Re: MySQL doesn't save - by zT KiNgKoNg - 26.09.2013, 10:24
Re: MySQL doesn't save - by x96664 - 26.09.2013, 10:36
Re: MySQL doesn't save - by Konstantinos - 26.09.2013, 10:41
Re: MySQL doesn't save - by x96664 - 26.09.2013, 11:10
Re: MySQL doesn't save - by Konstantinos - 26.09.2013, 11:22
Re: MySQL doesn't save - by x96664 - 26.09.2013, 12:57

Forum Jump:


Users browsing this thread: 5 Guest(s)