SA-MP Forums Archive
OnPlayerUpdate Optimize - 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 Optimize (/showthread.php?tid=495538)



OnPlayerUpdate Optimize - GoldZoroGrab - 17.02.2014

Hello!

If I added 10 seconds timer in the OnPlayerUpdate, and transfared everything from onplayerupdate to the timer will it help to optimize the server cpu?


Re: OnPlayerUpdate Optimize - tuitalker - 17.02.2014

in onplayerupdate the client sends a lot of information to the server such as player position, shooting position, weapon etcc. you can't set a timer on it, it sends requests without stopping.


Re: OnPlayerUpdate Optimize - GoldZoroGrab - 17.02.2014

Do it take big space in the cpu? the 'OnPlayerUpdate' I got much 'If' in it


Re: OnPlayerUpdate Optimize - Lidor124 - 17.02.2014

Yes, i highly recommend you to put all your stuff on other public or just create one. you can use normal timers for that.


Re: OnPlayerUpdate Optimize - Memoryz - 17.02.2014

OPU is called several times every second, which would result in your server being spammed with timers every time a person's client sends an update.


Re: OnPlayerUpdate Optimize - GoldZoroGrab - 17.02.2014

So what you guys recommend me to do exactly?


Re: OnPlayerUpdate Optimize - Tamer - 17.02.2014

Read Cessils's topic, he has info about how to limit OPU.

https://sampforum.blast.hk/showthread.php?tid=220089