Timers Problem
#1

Recently i've got a problem with timer. On my host timers just mess up. I don't have that much timers or conde in them....I have 2 global timers and 5 per player(for usual things like mute, speed , fuel...)
When i give mute to someone(or me) for 100 seconds(example) the mutes seconds go down for what..From 100 jump at 80 then to 60 and in like 5-6 seconds you don't have mute anymore......
I kill every timer when its need (OnPlayerDisconnect or when its not used)....
What can cause this mess up?
Reply
#2

Are you sure that you are created timers, like this?
Код:
var = SetTimer...
And then killing it by using
Код:
KillTimer(var);
On Gamemode exit?

And why bother creating player timers for fuel, speed? or even mute?
Just create a global timer, Loop through all players,
And check there whatever you want to check,
More timers = More lag.
Reply
#3

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
Are you sure that you are created timers, like this?
Код:
var = SetTimer...
And then killing it by using
Код:
KillTimer(var);
On Gamemode exit?

And why bother creating player timers for fuel, speed? or even mute?
Just create a global timer, Loop through all players,
And check there whatever you want to check,
More timers = More lag.
Yep, all timers are saved into a variabile and then killed when need to be

Not really , if the fucntion called by the timer has eficinet or less code will not cause that much lag
Reply
#4

Better case; unix timestamps:

https://sampforum.blast.hk/showthread.php?tid=254915

IIRC, timers become inaccurate and buggy after some time. Don't quote me, but I believe that's why y_timers was made.
Reply
#5

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
And why bother creating player timers for fuel, speed? or even mute?
Just create a global timer, Loop through all players,
And check there whatever you want to check,
More timers = More lag.
Timers do not create lag whether you create 100 timers or 1 it is all same. It depends upon the code inside.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)