13.06.2016, 13:15
Hello everyone,
I've been out of scripting sa-mp for years now. I would like to get back into it a littlebit to play around with MySQL.
Now I am trying to give money to a player with the following function:
Now it does send the client message, but it doesn't give the player his money. Is there something wrong with the query or perhaps the mysql_tquery?
Thanks in advance
I've been out of scripting sa-mp for years now. I would like to get back into it a littlebit to play around with MySQL.
Now I am trying to give money to a player with the following function:
Код:
forward updateStats(playerid);
public updateStats(playerid)
{
new query[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
mysql_format(mysql, query, sizeof(query), "SELECT `Money` FROM `accounts` WHERE `Name` = '%e' LIMIT 1", playername);
mysql_tquery(mysql, query, "", "i", playerid);
Player[playerid][Money] = cache_get_field_content_int(0, "Money");
GivePlayerMoney(playerid, Player[playerid][Money]);
SendClientMessage(playerid, -1, "Updated");
return 1;
}
Thanks in advance


