Timer Problem. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timer Problem. (
/showthread.php?tid=258349)
Timer Problem. -
Admigo - 30.05.2011
Heey guys,
I have made a gametimer for my cops and robbers and i use more timers. Normally if i dont use other timers the timer works fine. But when i use the other timers to the gametimer takes longer.
Is there not a plugin or something to fix this?
Thanks Admigo.
Re: Timer Problem. -
Lorenc_ - 30.05.2011
Minus the gametime timer to about half its time, if theres alot timers try your best to delete them and store all of them in one timer
pawn Код:
enum TIMER_DATA
{
E_TIMER_INTERVAL[20(Amount of timers you want to store)]
}
new gTimerData[TIMER_DATA];
forward timer();
public timer()
{
gTimerData[E_TIMER_INTERVAL][1] = gTimerData[E_TIMER_INTERVAL][1] + 500;// timer one, each time the timer is called it will do this; lets say this timer is set to 500ms
if(gTimerData[E_TIMER_INTERVAL][1] == 2000) // 2 seconds call this:
{
gTimerData[E_TIMER_INTERVAL][1] = 0; Reset
//code..
}
}
Dont have to follow that but just a tip to shortening timers.
Re: Timer Problem. -
Admigo - 30.05.2011
Quote:
Originally Posted by Lorenc_
Minus the gametime timer to about half its time, if theres alot timers try your best to delete them and store all of them in one timer
pawn Код:
enum TIMER_DATA { E_TIMER_INTERVAL[20(Amount of timers you want to store)] } new gTimerData[TIMER_DATA];
forward timer(); public timer() { gTimerData[E_TIMER_INTERVAL][1] = gTimerData[E_TIMER_INTERVAL][1] + 500;// timer one, each time the timer is called it will do this; lets say this timer is set to 500ms
if(gTimerData[E_TIMER_INTERVAL][1] == 2000) // 2 seconds call this: { gTimerData[E_TIMER_INTERVAL][1] = 0; Reset //code.. } }
Dont have to follow that but just a tip to shortening timers.
|
CAn you explain it with this?
Код:
SetTimer("Jailed",1000,true);
SetTimer("UpdateJP", 30000, true); //Updates the jackpot
SetTimer("PlayerOneSecondVariables",1000,1);
SetTimer("ServerOneSecondVariables",1000,1);
SetTimer("checkpointUpdate",1100,1);
SetTimer("SFPDGatesOpen",1000,1);
SetTimer("ArmyGatesOpen",1000,1);
SetTimer("TaxiPay",60000,1);
SetTimer("HasSTITimer",10000,1);
SetTimer("IncreaseTime", 100, true);//1000
Re: Timer Problem. -
Admigo - 30.05.2011
Need explain!
Re: Timer Problem. -
Lorenc_ - 01.06.2011
I perfer to talk to you on MSN or any thing to chat with, this will take me hours to do with the forums posting..