OnPlayerUpdate - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerUpdate (
/showthread.php?tid=358457)
OnPlayerUpdate -
CoDeZ - 10.07.2012
Hello guys , i have like 10 if statments under my onplayerupdate to check the score of the player , so i can use it into an info box for the player , and ofcourse i am using a textdraw
The question is , is this wrong what am i doing?
Can this lag the server?
Thanks.
Re: OnPlayerUpdate -
Vince - 10.07.2012
If you're using 10 if-statements to do one simple thing then yes, there is something wrong. You should probably resort to using a repeating timer instead (~3 seconds).
Re: OnPlayerUpdate -
CoDeZ - 10.07.2012
Dunno if its simple or not , but i'll show
pawn Код:
if GetPlayerScore(playerid) >= RANK10SCOREa && GetPlayerScore(playerid) <=RANK10SCOREb*then
{
TextDrawAlignment(RankDraw10,0);
TextDrawBackgroundColor(RankDraw10,0xff000099);
TextDrawFont(RankDraw10,1);
TextDrawLetterSize(RankDraw10,0.299999,1.300000);
TextDrawColor(RankDraw10,0xFFFFFFFF);
TextDrawSetOutline(RankDraw10,1);
TextDrawSetProportional(RankDraw10,1);
TextDrawShowForPlayer(playerid,RankDraw10);
TextDrawHideForPlayer(playerid,RankDraw1);
TextDrawHideForPlayer(playerid,RankDraw3);
TextDrawHideForPlayer(playerid,RankDraw4);
TextDrawHideForPlayer(playerid,RankDraw5);
TextDrawHideForPlayer(playerid,RankDraw2);
TextDrawHideForPlayer(playerid,RankDraw7);
TextDrawHideForPlayer(playerid,RankDraw8);
TextDrawHideForPlayer(playerid,RankDraw6);
TextDrawHideForPlayer(playerid,RankDraw9);
TextDrawHideForPlayer(playerid,RankDraw11);
}