Giving money with mysql query has no effect
#1

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:

Код:
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;
}
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
Reply


Messages In This Thread
Giving money with mysql query has no effect - by bartje01 - 13.06.2016, 13:15
Re: Giving money with mysql query has no effect - by F1N4L - 13.06.2016, 13:18
Re: Giving money with mysql query has no effect - by bartje01 - 13.06.2016, 13:23
Re: Giving money with mysql query has no effect - by Konstantinos - 13.06.2016, 13:28
Re: Giving money with mysql query has no effect - by F1N4L - 13.06.2016, 13:32
Re: Giving money with mysql query has no effect - by Konstantinos - 13.06.2016, 13:36
Re: Giving money with mysql query has no effect - by bartje01 - 13.06.2016, 13:36

Forum Jump:


Users browsing this thread: 2 Guest(s)