What are some causes of script lag?
#1

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

Repeating timers calling slow codes and functions.
Reply
#3

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

What kind of robbing like a player or like a mini mission
Reply
#5

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

Chrism add a Streamer are they createobject .... or createdynamicobject
Reply
#7

Loops can cause lag...
Reply
#8

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

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

ok, well would the objects effect it much?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)