OnPlayerUpdate problem
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
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.
That is the best way just make it a function like this then call that whenever you need an update.

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;
}
Reply


Messages In This Thread
OnPlayerUpdate problem - by Fantje - 14.03.2015, 09:38
Re: OnPlayerUpdate problem - by CalvinC - 14.03.2015, 09:52
Re: OnPlayerUpdate problem - by Fantje - 14.03.2015, 09:52
Re: OnPlayerUpdate problem - by PrivatioBoni - 14.03.2015, 09:58
Re: OnPlayerUpdate problem - by Fantje - 14.03.2015, 10:24
Re: OnPlayerUpdate problem - by ReD_HunTeR - 14.03.2015, 10:35
Re: OnPlayerUpdate problem - by Fantje - 14.03.2015, 10:45
Re: OnPlayerUpdate problem - by Tamer - 14.03.2015, 10:50
Re: OnPlayerUpdate problem - by Vince - 14.03.2015, 11:02
Re: OnPlayerUpdate problem - by Pottus - 14.03.2015, 14:29

Forum Jump:


Users browsing this thread: 4 Guest(s)