lag - OnPlayerUpdate? [application-optimize code]
#4

Quote:
Originally Posted by Shetch
Посмотреть сообщение
OnPlayerUpdate gets called very frequently each second depending on what the player is doing. This is a quote from the SA-MP wiki:

This could mean that OnPlayerUpdate gets called about 10-50 times in a second while the player is doing something meaning everything you have under OnPlayerUpdate is processed way more than you would possibly need to.

A solution to this is to move all the code you have under OnPlayerUpdate to a timer. This timer could be a single second timer or even a half second timer. Either way, it would be much better for your server's performance to use a timer instead of OnPlayerUpdate.
Give me an example of a similar timer with the OnPlayerUpdate?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)