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



Optimize script - ahmedraed - 09.07.2015

HI,i've downloaded a Samp GM for COD total war but when i put it it takes like 100%cpu usage or 107% so please anyone can help me,please !?


Re: Optimize script - Younes44 - 09.07.2015

wut do you want ?


Re: Optimize script - Michael B - 09.07.2015

I guess your host is poor and lacking of CPU.
Have a look on the gamemode itself and seek for mappings / timers which may affect your server's performance.

Could you post your hosts specs as well?


Re: Optimize script - Jake187 - 09.07.2015

Quote:
Originally Posted by Michael B
Посмотреть сообщение
I guess your host is poor and lacking of CPU.
Have a look on the gamemode itself and seek for mappings / timers which may affect your server's performance.

Could you post your hosts specs as well?
I am doubtful it's the hosts fault if hes using 100% of a CPU core. He should be able to hold at least 200 players on a optimized gamemode even if it's a crappy Atom 1.6GHz CPU core.

So clearly it's the GM.


Re: Optimize script - ahmedraed - 09.07.2015

it is GM issue i've like 6timers i think ;-;
are they them ?._. as i am newbie not too good about scripting
Quote:

new Text3Dis[MAX_PLAYERS];
new PingTimer;
new bool:Synching[MAX_PLAYERS];
new FloatPos[MAX_PLAYERS][3];
new FloatHP[MAX_PLAYERS];
new FloatAP[MAX_PLAYERS];
new sWeap[MAX_PLAYERS][13];
new sAmmo[MAX_PLAYERS][13];

or these?
Quote:

new BlipTimer[MAX_PLAYERS];
new JailTimer[MAX_PLAYERS];
new FreezeTimer[MAX_PLAYERS];
new LockKickTimer[MAX_PLAYERS];

Quote:

hosts specs

what do you mean with that?


Re: Optimize script - Michael B - 09.07.2015

Where are you hosting your server at? Also, which gamemode are you actually using?

Quote:
Originally Posted by Jake187
Посмотреть сообщение
I am doubtful it's the hosts fault if hes using 100% of a CPU core. He should be able to hold at least 200 players on a optimized gamemode even if it's a crappy Atom 1.6GHz CPU core.

So clearly it's the GM.
He might be hosting on a 128mb RAM single core VPS along wih MySQL, so that could get him in trouble.


Re: Optimize script - Vince - 09.07.2015

Gamemode is shit. Has an infinite loop or is wrecking OnPlayerUpdate. Find another gamemode if you can't fix it.


Re: Optimize script - prineside - 09.07.2015

If it constantly uses 100% of cpu you should check your gamemode first. Looks like there is an infinite loop somewhere inside it.
If you are able to stop SA-MP server with "exit" console command or in any other way which calls OnGameModeExit, I suggest you to use profiler plugin to find a problem (it should point you to a hungry function).
If you can't stop server in regular way (Ctrl+C, "exit", /rcon gmx and so on) and the only way to stop it is to kill a process, you should find another (better) gamemode or try to locate that loop (but it's another topic)


Re: Optimize script - Jake187 - 09.07.2015

Quote:
Originally Posted by Michael B
Посмотреть сообщение
He might be hosting on a 128mb RAM single core VPS along wih MySQL, so that could get him in trouble.
Yes but hes stating that the SAMP server is using 100% of the CPU Core so clearly it's his own server causing the problem, it's nobodies fault besides his own and the GM is a piece of crap.


Re: Optimize script - ahmedraed - 10.07.2015

well,anyone can help me as i am still newbie at scripting not good much i've searched alot and found another one it is like the first one and have the some problem..can anyone fix it ? or atleast tell me things that i can understand or give me some links that might help me,please?,thanks