20.02.2011, 08:11
Hey all,
While writing a script it's important for me to make it as efficient as I can do it.
So I taught about what would be better:
For example(!), I have a timer which repeats every second and checks for cheats. Furthermore the players speed (in vehicle) should be updated every second (speedometer) and a clock every 60 seconds.
So we have two functions which runs all the time (cheat-detector and clock-updater) and one which actually only have to run if the player is in a vehicle. Cheat-Detector and speedometer with the same interval and the clock * 60
What would be the best way to do it?
1. A seperate timer for each function (and each player who enters a vehicle)
2. Speedometer together with cheatfunction (for -> if in vehicle)
3. All together (2. + if sec == 60 do min++)
I don't exactly know how timers work so I ask for your knowledge![smiley](images/smilies/smile.gif)
Phoenix
While writing a script it's important for me to make it as efficient as I can do it.
So I taught about what would be better:
For example(!), I have a timer which repeats every second and checks for cheats. Furthermore the players speed (in vehicle) should be updated every second (speedometer) and a clock every 60 seconds.
So we have two functions which runs all the time (cheat-detector and clock-updater) and one which actually only have to run if the player is in a vehicle. Cheat-Detector and speedometer with the same interval and the clock * 60
What would be the best way to do it?
1. A seperate timer for each function (and each player who enters a vehicle)
2. Speedometer together with cheatfunction (for -> if in vehicle)
3. All together (2. + if sec == 60 do min++)
I don't exactly know how timers work so I ask for your knowledge
![smiley](images/smilies/smile.gif)
Phoenix