SA-MP Forums Archive
tutorials about 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: tutorials about timers??? (/showthread.php?tid=149285)



tutorials about timers??? - pmk1 - 21.05.2010

hey guys i want to creat timers for some commands and stuff, but i'd like to learn it. I've searched for tutorials buti found nothing, not even on wiki.sa-mp.com. can someone give me a link for a tutorial or create one? thanks


Re: tutorials about timers??? - DJDhan - 21.05.2010

SetTimer.

SetTimerEx.


Re: tutorials about timers??? - ViruZZzZ_ChiLLL - 21.05.2010

https://sampwiki.blast.hk/wiki/SetTimer

https://sampwiki.blast.hk/wiki/SetTimerEx

Also, study this :
pawn Код:
// Put a SetTimer / SetTimerEx anywhere.

forward UnFreeze(playerid);
public UnFreeze(playerid) // this will be the effect
{
   TogglePlayerControllable(playerid, 1);

}



Re: tutorials about timers??? - pmk1 - 21.05.2010

thanks but i i'd like a tutorial like maybe how to make a timer for a command by example, and it would explain what to do


Re: tutorials about timers??? - DJDhan - 21.05.2010

Arite here's an example:


At top of the script
Код:
new timertime=1000; //1 second
new timer;
Anywhere:
Код:
forward function();

public function()
{
SendClientMessageToAll(0xFF0000AA,"Hello!");
return 1;
}
Now OnPlayerSpawn or anywhere:

Код:
timer=SetTimer("function",time,1); // 1 for repeating and 0 for non-repeating
What this will do is Send client a message every 1 second "Hello".

Hope this helps


Re: tutorials about timers??? - pmk1 - 21.05.2010

yea thanks djd, your really usefull


Re: tutorials about timers??? - DJDhan - 21.05.2010

Quote:
Originally Posted by pmk1
yea thanks djd, your really usefull
Np (helpful :P)


Re: tutorials about timers??? - pmk1 - 21.05.2010

lol yeah helpfull