04.03.2011, 16:16
try this
pawn Код:
new Timer;//this one up of all
new C=0;//this one up of all
if(strcmp(cmd, "/cd", true) == 0)//this in onplayercommandtext
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /cd [Time in seconds]");
return 1;
}
new time;
time = strval(tmp);
Timer = SetTimer("CountDown",1000,1);
C=time+1;
return 1;
}
forward CD(time);//this where u want not in other callbacks
public CD(time)
{
new string[128];
C--;
format(string,sizeof(string),"%d",C);
GameTextForAll(string,1000,3);
if(C <= 0)
{
GameTextForAll("GO",1000,3);
KillTimer(Timer);
}
}