Will this cause lagg?
#1

Since having big code in OnPlayerUpdate will cause your server to lagg, I decided to make my own with a timer and a function.
But the problem is, I want to use playerid in it so I have to use settimerex. But I can only put that under onplayerconnect (gamemodeinit doesnt have playerid)
My question is: Will it cause lagg? Because it creates a new timer for every player in the server?
And if it causes lagg, what can I do to make it better?

My code:
pawn Код:
//On top:
new playerupdatetimer[MAX_PLAYERS];
forward PlayerUpdate(playerid);


// OnPlayerConnect:
playerupdatetimer[playerid] = SetTimerEx("PlayerUpdate", 450, 1, "i", playerid);

//OnPlayerDisconnect:
KillTimer(playerupdatetimer[playerid]);

//The UpdatePlayer function
public PlayerUpdate(playerid)
{
return 1;
}
Thanks!
Reply


Messages In This Thread
Will this cause lagg? - by Rzzr - 17.01.2010, 22:25
Re: Will this cause lagg? - by [HiC]TheKiller - 17.01.2010, 22:29
Re: Will this cause lagg? - by Rzzr - 17.01.2010, 22:31
Re: Will this cause lagg? - by shady91 - 17.01.2010, 22:33
Re: Will this cause lagg? - by Rzzr - 17.01.2010, 22:39
Re: Will this cause lagg? - by Correlli - 17.01.2010, 22:39
Re: Will this cause lagg? - by Joe Staff - 17.01.2010, 22:42
Re: Will this cause lagg? - by Rzzr - 17.01.2010, 22:55
Re: Will this cause lagg? - by Correlli - 17.01.2010, 23:05
Re: Will this cause lagg? - by Rzzr - 17.01.2010, 23:12

Forum Jump:


Users browsing this thread: 1 Guest(s)