14.03.2015, 14:29
Quote:
It doesn't even need a timer. You can just call that function whenever one of those variables updates. OnPlayerUpdate is not your one-size-fits-all general timer. Do not use timers if you can avoid them.
|
pawn Код:
UpdateTextDrawStats(playerid)
{
new string[128], playerid, Float:ratio = floatdiv(PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths]);
format(string, sizeof(string), "~y~Score: ~w~%d~n~~y~Money: ~w~$%d~n~~y~Kills: ~w~%d~n~~y~Deaths: ~w~%d~n~~y~K/D Ratio: ~w~%0.2f", GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], ratio);
TextDrawSetString(Textdraw[playerid], string);
TextDrawShowForPlayer(playerid, Textdraw[playerid]);
return 1;
}