Settimer - 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: Settimer (
/showthread.php?tid=318517)
Settimer -
bleedis - 15.02.2012
Hey guy!
I want to ask a question about timer time. If there can be any lags when checkpoint time is set to 1? Like when someone is in car or on foot the chekpoint is visible all the time.
pawn Код:
SetTimer("Stuff goes here", 1, 1);
Thanks!
Re: Settimer -
fordawinzz - 15.02.2012
well, you don't need 1 ms, you need like 1 second (1000ms).
Re: Settimer -
ComiGF - 15.02.2012
First,you have to add a variable for timer in this format:
Код:
forward TimersName (playerid);
Than,add a timer in a command,or somewhere else:
Код:
SetTimer("TimersName",10000,0); // 10000 is number of miliseconds,after that timer is active (1000ms -10 seconds)
After that,just add 0
At last,you have to add new public at end of your script:
Код:
public TimersName(playerid)
{
// Do something here,what will happen,after 10 seconds..
return 1;
}
Re: Settimer -
bleedis - 16.02.2012
Quote:
Originally Posted by ComiGF
First,you have to add a variable for timer in this format:
Код:
forward TimersName (playerid);
Than,add a timer in a command,or somewhere else:
Код:
SetTimer("TimersName",10000,0); // 10000 is number of miliseconds,after that timer is active (1000ms -10 seconds)
After that,just add 0
At last,you have to add new public at end of your script:
Код:
public TimersName(playerid)
{
// Do something here,what will happen,after 10 seconds..
return 1;
}
|
Thanks for explanation dude!

I know how it works. Im just wondering if i set time to 1ms it can cause a lags?