24.11.2013, 08:33
I tried searching but I cant find a tutorial that explains how to make a countdown (i.e 4:00 , 3:59 , 3:59 ..)
Reply number 3 should help you out somewhat: https://sampforum.blast.hk/showthread.php?tid=315000
|
pawn Код:
|
new mins;
new secs;
new CTTimer;//On Top Of Your Script
forward CT(playerid);
public CT(playerid)
{
if(mins + secs > -1)
{
if(secs > -1)
{
new str[10];
format(str,10,"%i:%i",mins,secs);
GameTextForPlayer(playerid,str,500,6);
secs = secs - 1;
}
else
{
mins = mins - 1;
secs = 59;
new str[10];
format(str,10,"%i:%i",mins,secs);
GameTextForPlayer(playerid,str,500,6);
secs = secs - 1;
}
}
else
{
GameTextForPlayer(playerid,"GO !",500,6);
KillTimer(CTTimer);
}
return 1;
}
//put this where you want to start the timer
mins = 0;//change it with the value of minutes
secs = 3;//change it with the value of seconds
CTTimer = SetTimerEx("CT",1000,1,"iii",playerid);