• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] refresh query every 1 sec
#1
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



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;

}
  Reply


Messages In This Thread
refresh query every 1 sec - by Zow - 2021-05-01, 11:40 AM
RE: refresh query every 1 sec - by AbyssMorgan - 2021-05-01, 11:49 AM
RE: refresh query every 1 sec - by Radical - 2021-05-01, 01:31 PM
RE: refresh query every 1 sec - by Y_Less - 2021-05-01, 05:17 PM
RE: refresh query every 1 sec - by Zow - 2021-05-01, 08:59 PM

Forum Jump: