06.07.2013, 13:11
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;
}