Help SetTimer
#2

Use SetTimerEx, if you want to make the timer separate for each player. This is the easiest way for newbies to learn, HOWEVER, I guess you can use "y_timers" if you wish(I am not sure however, just ****** it if you don't like this way).

pawn Код:
new countn1[MAX_PLAYERS];
new counttimer1[MAX_PLAYERS];
forward TimerWithText(playerid);

public OnPlayerSpawn(playerid)
{
     countn1[playerid]=10;
     counttimer[playerid]=SetTimerEx("TimerWithText",1000,true,"i",playerid);
     return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
     if(countn1[playerid]!=0)
               KillTimer(counttimer1[playerid]);
     return 1;
}

public TimerWithText(playerid)
{
     new string[128];
     format(string,"%d second(s) left until the timer reaches 0!", countn1[playerid]);
     GameTextForPlayer(playerid,string,2000,4);
     if(countn1[playerid]!=0)
              countn1[playerid]--;
     else
              KillTimer(counttimer1[playerid]);
     return 1;
}
Reply


Messages In This Thread
Help SetTimer - by xganyx - 06.07.2013, 12:49
Re: Help SetTimer - by Cjgogo - 06.07.2013, 13:11
Re: Help SetTimer - by nickyW - 06.07.2013, 13:12
Re: Help SetTimer - by Cjgogo - 06.07.2013, 13:15
Re: Help SetTimer - by xganyx - 06.07.2013, 14:32
Re: Help SetTimer - by nickyW - 06.07.2013, 14:47
Re: Help SetTimer - by xganyx - 06.07.2013, 15:25
Re: Help SetTimer - by nickyW - 06.07.2013, 15:47
Re: Help SetTimer - by xganyx - 07.07.2013, 01:47
Re: Help SetTimer - by xganyx - 07.07.2013, 06:36

Forum Jump:


Users browsing this thread: 2 Guest(s)