OnPlayerUpdate
#1

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.
Reply
#2

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).
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)