Having an issue with MySQL
#1

pawn Код:
stock UpdatePlayerData(playerid)
{
    if(Player[playerid][IsLoggedIn] == false)
        return 0;

    new Float:x,Float:y,Float:z, Float:GetHealth, Float:GetArmour, admtitle2;
    GetPlayerPos(playerid, x,y,z);
    admtitle2 = Player[playerid][AdminTitle];
    GetPlayerHealth(playerid, GetHealth);
    GetPlayerArmour(playerid, GetArmour);
    new query[256];
    mysql_format(SQL, query, sizeof(query), "UPDATE `players` SET `money` = '%d', `skin` = '%d', `x` = '%f', `y` = '%f', `z` = '%f', `admin` = '%d', `health` = '%f', `armour` = '%f', `level` = '%d', `kills` = '%d', `deaths` = '%d', `admintitle` = '%s' WHERE `id` = '%d' LIMIT 1", GetPlayerMoney(playerid), Player[playerid][Skin],x,y,z, Player[playerid][Admin],GetHealth, GetArmour, Player[playerid][Level],Player[playerid][Kills],Player[playerid][Deaths],admtitle2, Player[playerid][ID]);
    mysql_tquery(SQL, query, "", "");
    return 1;
}
It's not saving properly ever since I added the admintitle bit.

Here's the log.

http://prntscr.com/2ygljg
Reply
#2

The log is saying that the destination size is too small. So increase the size of your variable 'query'.
Reply
#3

Thank you mate. Rep +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)