Hosting issues.
#1

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

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

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

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

What does changin OnPlayerUpdate to OnPlayerUpdateEx makes difference? o.o
Reply
#6

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

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

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)