Impossible to save stats
#16

Except the missing single quote that gave syntax error after modifying it, the query itself is working. The problem of not updating the database is that you never assign the new value to the variables:
Code:
CMD:setskin(playerid, params[])
{
    new playerb, value;

    if (sscanf(params, "ui", playerb, value))
        return SendClientMessage(playerid, -1, "{88AA88}/setskin {FFFFFF}[playerid/nom] [id skin]");

    GameTextForPlayer(playerid, "nouveau skin", 1000, 1);

    SetPlayerSkin(playerb, value);
    Player[playerb][Skin_Player] = value;

    UpdatePlayerData(playerid);
    return 1;
}


CMD:givemoney(playerid, params[])
{
    new playerb, value;

    if (sscanf(params, "ui", playerb, value))
        return SendClientMessage(playerid, -1, "{88AA88}/givemoney {FFFFFF}[playerid/nom] [somme]");

    GameTextForPlayer(playerid, "nouveau skin", 1000, 1);

    GivePlayerMoney(playerb, value);
    Player[playerb][Cash] = value;

    UpdatePlayerData(playerid);
    return 1;
}
so it just re-updated those two columns with the value of 0.

On another note, please check if playerb is valid (connected) player before using it in arrays to avoid run time error 4.
Reply


Messages In This Thread
Impossible to save stats - by Klayton - 20.12.2017, 00:20
Re: Impossible to save stats - by Logok987 - 20.12.2017, 10:26
Re: Impossible to save stats - by DelK - 20.12.2017, 10:38
Re: Impossible to save stats - by Klayton - 20.12.2017, 13:14
Re: Impossible to save stats - by aoky - 20.12.2017, 13:20
Re: Impossible to save stats - by Klayton - 20.12.2017, 13:47
Re: Impossible to save stats - by aoky - 20.12.2017, 13:47
Re: Impossible to save stats - by Klayton - 20.12.2017, 13:49
Re: Impossible to save stats - by Konstantinos - 20.12.2017, 13:51
Re: Impossible to save stats - by aoky - 20.12.2017, 13:52
Re: Impossible to save stats - by Klayton - 20.12.2017, 13:54
Re: Impossible to save stats - by aoky - 20.12.2017, 13:56
Re: Impossible to save stats - by Klayton - 20.12.2017, 13:57
Re: Impossible to save stats - by Konstantinos - 20.12.2017, 14:01
Re: Impossible to save stats - by Klayton - 20.12.2017, 14:10
Re: Impossible to save stats - by Konstantinos - 20.12.2017, 14:16
Re: Impossible to save stats - by Klayton - 20.12.2017, 14:18

Forum Jump:


Users browsing this thread: 2 Guest(s)