the server is full of lags, help -
matanm - 10.07.2011
I've a RolePlay mode, and when i play alone on a linux server it work perfect, there are no lags.
but, when someone is logging in too, and we're 2 players in the server, the server is full of lags, there is a deley of 10 seconds when you write, you can't see your friend on his real walking, i mean when he walk straight and then right, you see that he walked only straight, and then sunddenly "teleported" to other place.
please help me, thanks.
Re: the server is full of lags, help -
Kush - 10.07.2011
Many things can cause lag, from outdated systems, to 'obsolete' functions, timers, to simply using the 'wrong' callbacks. If your wishing to 'upgrade' 'your' Gamemode, take a look around the forums. Use the search function, and search for newer things which were meant for the current SA:MP version.
Re: the server is full of lags, help -
iPLEOMAX - 10.07.2011
Few Common solutions:
- Don't add load of stuff to OnPlayerUpdate.
- Optimize your script.
- Reduce the usage of timers.
- Check if the connections are good.
- Don't add too many filterscripts/plugins.
Thats all from a newbie pawner.
Re: the server is full of lags, help -
Adil - 10.07.2011
Don't use
OnPlayerUpdate for saving user data if you are.
Re: the server is full of lags, help -
matanm - 10.07.2011
so what should i do ? the use date won't be saved ?
Re: the server is full of lags, help -
linuxthefish - 10.07.2011
If you must use a timer for saving data, save it every 15/30 mins.
Re: the server is full of lags, help -
Vince - 10.07.2011
Rename the callback (e.g. to OnPlayerUpdateEx) and set it on a slow timer (every 5 or 10 minutes or so). Also call it when a player disconnects.
Re: the server is full of lags, help -
Adil - 10.07.2011
Just make a new callback
SaveAccount and call it
OnPlayerDisconnect. Create a new safe gmx command and don't use gmx in console, or the player coordinates, health, weapons will be set to 0.