Not saving stats [MYSQL]
#7

try this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
     new query[800], Float:pos[4];
     GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
     GetPlayerFacingAngle(playerid, pos[3]);
     mysql_format(mysql, query, sizeof(query), "UPDATE accounts SET Money='%d',PosX='%f',\
     PosY='%f', PosZ='%f', PosA='%f', Kills='%d', \
     Deaths='%d' WHERE ID='%d'"
, Player[playerid][Money], pos[0], pos[1], pos[2], pos[3],
     Player[playerid][Kills], Player[playerid][Deaths], Player[playerid][ID]);
     mysql_tquery(mysql, query, "", "");
     return true;
}
You didn't provide Player ID in the query. Use server-side money so cheats will not work.
Example:
pawn Код:
stock GivePlayerCash(playerid, cash)
{
   Player[playerid][Money] += cash;
   GivePlayerMoney(playerid, cash);
}

CMD:cash(playerid, params[])
{
 GivePlayerCash(playerid, 282004);
}
Reply


Messages In This Thread
Not saving stats [MYSQL] - by robibacsika - 07.12.2018, 05:52
Re: Not saving stats [MYSQL] - by Calisthenics - 07.12.2018, 06:32
Re: Not saving stats [MYSQL] - by robibacsika - 07.12.2018, 06:41
Re: Not saving stats [MYSQL] - by robibacsika - 07.12.2018, 06:48
Re: Not saving stats [MYSQL] - by Calisthenics - 07.12.2018, 07:09
Re: Not saving stats [MYSQL] - by robibacsika - 07.12.2018, 07:56
Re: Not saving stats [MYSQL] - by UFF - 07.12.2018, 08:59
Re: Not saving stats [MYSQL] - by Calisthenics - 07.12.2018, 11:54

Forum Jump:


Users browsing this thread: 3 Guest(s)