How to insert value of GetPVarInt into a player text draw
#6

OnPlayerConnect but now I added a timer there

pawn Код:
CashTextDraw[playerid] = CreatePlayerTextDraw(playerid, 560.0, 100.0, "Cash: 0");
PlayerTextDrawSetShadow(playerid, CashTextDraw[playerid], 1);
PlayerTextDrawAlignment(playerid, CashTextDraw[playerid], 3);
PlayerTextDrawFont(playerid, CashTextDraw[playerid], 1);
PlayerTextDrawColor(playerid, CashTextDraw[playerid], 0xFF0000AA);
PlayerTextDrawSetOutline(playerid, CashTextDraw[playerid], 1);
PlayerTextDrawShow(playerid, CashTextDraw[playerid]);

SetPVarInt(playerid, "Cash", 362528);
SetTimerEx("UpdateCashAmount", 1500, true, "i", playerid);
pawn Код:
public UpdateCashAmount(playerid)
{
new PlayerCashBalance[25];
format(PlayerCashBalance, sizeof(PlayerCashBalance), "Cash: %d", GetPVarInt(playerid, "Cash"));
PlayerTextDrawSetString(playerid, CashTextDraw[playerid], PlayerCashBalance);
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)