Posts: 393
Threads: 105
Joined: Dec 2014
Reputation:
0
Heey guys,
I made a server and I get huge lag when I am near another player. Everyone has the same problem. I think it's something causing in my script...
I tried on different hosts and all got the problem.
Please help!
Posts: 378
Threads: 29
Joined: Aug 2015
Reputation:
0
Maybe your gamemode is un-optimized ?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Run profiler plugin. Also check for large chunks of code in OnPlayerUpdate.
Posts: 1,578
Threads: 15
Joined: Feb 2013
Reputation:
0
Well first thing is, optimize your code. Especially your arrays.
3 different arrays with 256 cells? Couldn't you reformat the same one?
And why do you do that under OnPlayerUpdate?
Just update the textdraw whenever something needs updating.
(For example, use OnPlayerDeath to update your kills and deaths etc..)
OnPlayerUpdate runs multiple times a second.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Nothing too extensive, but still completely unnecessary considering that all these things are controlled by the server. OnPlayerUpdate is meant to capture events that are controlled by the client and for which no specific callback exists. It is not a general purpose timer.
Kills/Deaths related textdraw should be moved to OnPlayerDeath. Score textdraw should be moved to wherever the score is updated.