SA-MP Forums Archive
Speeded up timers? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speeded up timers? (/showthread.php?tid=281637)



Speeded up timers? - Kyle_Olsen - 07.09.2011

I have a looping timer ( SetTimerEx("Payday", 100000, true, "d", playerid); ) that is set to go off every 100 seconds, as you can see.

However, sometimes, it goes a lot faster, like every 10 seconds or so.

What might be causing this?

I am sure I have ( return 1; ) in the public function.


Re: Speeded up timers? - dowster - 07.09.2011

is there another timer at all that may be getting called?
and also could you post the function the timer is in and the payday function please


Re: Speeded up timers? - [H]ead - 07.09.2011

Is There another timer receiving calls? Put the code ..


Re: Speeded up timers? - Kyle_Olsen - 07.09.2011

There's no other timer recieving calls, and what code would you like to see?

I've already shown you what starts the timer, and the public ( public Payday(playerid) ) does not include any timers of any kind.


Re: Speeded up timers? - =WoR=Varth - 07.09.2011

Payday code please.


Re: Speeded up timers? - [H]ead - 07.09.2011

Where did you put this SetTimer? Show CallBack PayDay.

Try change:
pawn Код:
SetTimerEx("Payday", 100000, true, "d", playerid);
to

pawn Код:
SetTimerEx("Payday", 100000, false, "d", playerid)
_

You should be calling him again.
Try changing also the name of the callback Payday for Payday2, it is possible that another script is calling


Re: Speeded up timers? - Kyle_Olsen - 07.09.2011

What you stated will make the timer be called only once.
The timer is started OnDialogResponse from a dialog created in OnPlayerConnect.


Re: Speeded up timers? - [H]ead - 07.09.2011

Quote:

What you stated will make the timer be called only once.
The timer is started OnDialogResponse from a dialog created in OnPlayerConnect.

Okay, Exactly.

Try to remove the SetTimerEx on OnPlayerDialog.

And put in the OnGameModeInit:
pawn Код:
SetTimer("Payday", 100000, true);
(you may have put loop players in Payday Callback)