tutorials about timers???
#1

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
Reply
#2

SetTimer.

SetTimerEx.
Reply
#3

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);

}
Reply
#4

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
Reply
#5

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
Reply
#6

yea thanks djd, your really usefull
Reply
#7

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

lol yeah helpfull
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)