countdown
#5

pawn Код:
new countn[MAX_PLAYERS];//It will count down,or normally,as you choose..
forward TimerName(playerid);//This is the function that will define the timer
new timer[MAX_PLAYERS];//This is the name of the timer,but there's one particulary for every player,as if we want to destroy it,it won't destroy for everyone

COMMAND:starttimer(playerid,params[])
{
   countn[playerid]=10;//It will count for 10 seconds
  timer[playerid]=SetTimerEx("TimerName",1000,true,"i",playerid);/We set the timer for 10 seconds,as you can see
 return 1;
}

//We now define the timer,like this:

public TimerName(playerid)
{
   countn[playerid]--;//The timer decreases from 10 to 0
   if(countn[playerid]>=-1)
  {
     KillTimer(timer[playerid]);
     //code[What your timer actually does]
   }
 return 1;
}
Not my code found on ****** but got like 5 errors anyone can tell the correct way of doing this?
Reply


Messages In This Thread
countdown - by thefatshizms - 13.09.2012, 19:42
Re: countdown - by Glint - 13.09.2012, 19:48
Re: countdown - by Djole1337 - 13.09.2012, 19:53
Re: countdown - by xMCx - 13.09.2012, 20:57
Re: countdown - by thefatshizms - 16.09.2012, 10:45
Re: countdown - by Vince - 16.09.2012, 10:50
Re: countdown - by thefatshizms - 16.09.2012, 10:56

Forum Jump:


Users browsing this thread: 2 Guest(s)