SA-MP Forums Archive
Hosting issues. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Hosting issues. (/showthread.php?tid=191904)



Hosting issues. - SeQualX - 20.11.2010

Well im currently using a GF edit and when we reach like 70+ players the server restarts a few times in a day, i thought that it was my script so i changed to another GF edition that a comunity used the reached 150 every day, but still resets due to CPU usage so the fault is from the hosting, do i have to host on VPS to get this restarts out? or a dedicated server? :S


Re: Hosting issues. - Woet - 20.11.2010

'Another GF edition' and you're wondering why you are using a lot of CPU? GF is horribly scripted and is known for using way too much CPU, especially in the gamemodes that use 'OnPlayerUpdate' for saving player files.


Re: Hosting issues. - SeQualX - 22.11.2010

Yeah i know that but what could i do to make less the CPU usage?


Re: Hosting issues. - Woet - 22.11.2010

Quote:
Originally Posted by SeQualX
Посмотреть сообщение
Yeah i know that but what could i do to make less the CPU usage?
Optimize the script and recode it properly, start by renaming OnPlayerUpdate to OnPlayerUpdateEx.


Re: Hosting issues. - SeQualX - 02.12.2010

What does changin OnPlayerUpdate to OnPlayerUpdateEx makes difference? o.o


Re: Hosting issues. - Woet - 02.12.2010

Quote:
Originally Posted by SeQualX
Посмотреть сообщение
What does changin OnPlayerUpdate to OnPlayerUpdateEx makes difference? o.o
Because OnPlayerUpdate is a native SA-MP callback that is called ~ 20 times per second per player?
You might want to read https://sampforum.blast.hk/showthread.php?tid=90943


Re: Hosting issues. - SeQualX - 02.12.2010

Yeah i know but is OnPlayerUpdateEx another native fixed or something like that? cause i saw this on ravens roleplay script.


Re: Hosting issues. - Woet - 03.12.2010

OnPlayerUpdate can be renamed to anything you wish, e.g. 'updatePlayer', 'writeFiles', whatever. If you rename it, it wont be called by SA-MP any more.


Re: Hosting issues. - SeQualX - 03.12.2010

ok thanks now i got it, im currently using OnPlayerUpdate just for a sleep system, so it changes the bar textdraw depending the ammount of sleep the players has, could i change that OnPlayerUpdate to OnPlayerUpdateEx and still workings fine?