SA-MP Forums Archive
What are some causes of script lag? - 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: What are some causes of script lag? (/showthread.php?tid=287816)



What are some causes of script lag? - chrism11 - 04.10.2011

Like the title, can you tell me the causes of lag. I know its the script, but im not sure exactly what to look for, ive condensed all the loops into one that i can, i thought it could be the vehicles, or maybe even the objects, so can you tell me what might be the problem?


Re: What are some causes of script lag? - Miguel - 04.10.2011

Repeating timers calling slow codes and functions.


Re: What are some causes of script lag? - chrism11 - 04.10.2011

what are some things you can do for robbing and stuff, without using timers?


Re: What are some causes of script lag? - BitlynkNetworks - 05.10.2011

What kind of robbing like a player or like a mini mission


Re: What are some causes of script lag? - chrism11 - 05.10.2011

a rob like attempt robbery, then a counter goes down for the amount of time left until your done robbing





Would 318 objects make it lag?


Re: What are some causes of script lag? - BitlynkNetworks - 05.10.2011

Chrism add a Streamer are they createobject .... or createdynamicobject


Re: What are some causes of script lag? - Pharrel - 05.10.2011

Loops can cause lag...


Re: What are some causes of script lag? - chrism11 - 05.10.2011

createdynamicobject and 38 createobject, but my reason for this is, im a scripter for a samp server, and i need to know how to fix the lag, i can fix it if i can find out what causes there can be. it seems to be getting worse and we cannot give any parts of the script out, says the owner, as im sure you understand


Re: What are some causes of script lag? - Vince - 05.10.2011

Main reasons are:
- OnPlayerUpdate
- OnPlayerUpdate
- OnPlayerUpdate
- Fast timers
- Slow functions
- Unoptimized or unnecessary loops
- Poorly optimized code (e.g. using floatmul, floatsub, etc for calculations)


Re: What are some causes of script lag? - chrism11 - 05.10.2011

ok, well would the objects effect it much?