07.12.2018, 08:59
(
Последний раз редактировалось UFF; 07.12.2018 в 12:44.
)
try this
You didn't provide Player ID in the query. Use server-side money so cheats will not work.
Example:
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;
}
Example:
pawn Код:
stock GivePlayerCash(playerid, cash)
{
Player[playerid][Money] += cash;
GivePlayerMoney(playerid, cash);
}
CMD:cash(playerid, params[])
{
GivePlayerCash(playerid, 282004);
}