2021-05-01, 11:40 AM
I want to refresh pCoin after people refill wallet
but I don't know how to do it better
just want real time Coin after refill
but I don't know how to do it better
just want real time Coin after refill
Code:
ptask RefreshCoinTimer[1000](playerid) {
? ? if (!LoginStatus[playerid]) {
? ? ? ? return 0;
? ? }
? ? new
? ? ? ? query[100]
? ? ;
? ? mysql_format(dbCon, query, sizeof(query),
? ? "\
? ? ? ? SELECT \
? ? ? ? ? ? pCoin \
? ? ? ? FROM \
? ? ? ? ? ? players \
? ? ? ? WHERE \
? ? ? ? ? ? ID= %d\
? ? ",
? ? ? ? PlayerInfo[playerid][pID]
? ? );
? ? mysql_tquery(dbCon, query, "RefreshCoin", "i", playerid);
? ? return 1;
}
forward RefreshCoin(playerid);
public RefreshCoin(playerid) {
? ? cache_get_value_name_int(0, "pCoin", coin);
? ? PlayerInfo[playerid][pCoin] = coin;
}