02.12.2012, 16:45
Either you can set a repeated timer or you can call the function every second and make it limited but yet repeated.
1. Setting a Repeated Timer without limits.
2. Setting a repeated timer with limits.
1. Setting a Repeated Timer without limits.
pawn Код:
forward function();
SetTimer("function", 1000, true); // Set a repeated timer of 1000 miliseconds (1 second)
public function()
{
print("Function has been called.");
}
2. Setting a repeated timer with limits.
pawn Код:
forward function(numb);
new no = 20;
new Timer = SetTimerEx("function", 1000, true,"d",no); // Set a repeated timer of 1000 miliseconds (1 second)
public function(numb)
{
if(numb == 0)
{
KillTimer(Timer);
}
print("Value:%d");
numb--;
}