07.01.2015, 18:02
Analisando o teu cуdigo acho que й isto que vocк queira
pawn Код:
forward OnAtualizaGrana(playerid, novaquantia);
public OnAtualizaGrana(playerid, novaquantia){
new rows, fields;
cache_get_data(rows, fields);
pInfo[playerid][Dinheiro] = cache_get_field_content_int(0, "Dinheiro");
pInfo[playerid][Dinheiro] += novaquantia;
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Dinheiro`= '%d' WHERE `ID`=%d",\
pInfo[playerid][Dinheiro], pInfo[playerid][ID]);
mysql_tquery(mysql, query, "", "");
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, pInfo[playerid][Dinheiro]);
return 1;
}
stock atualizarGrana(playerid, quantia){
new query[128];
pInfo[playerid][Dinheiro] = 0;
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Nome` = '%e' LIMIT 1", Name[playerid]);
mysql_tquery(mysql, query, "OnAtualizaGrana", "ii", playerid, quantia);
}