#1

As I aksed in my old topic, is there anyone who can help me how to do an countdown?
Reply
#2

Use the search button and read the rules
Reply
#3

Under includes:
Код:
forward CountDown();
new CountText[5][5] ={"~r~1","~b~2","~b~3","~g~4","~g~5"};
Under OnPlayerCommandText:
Код:
if (strcmp(cmdtext, "/count", true)==0)
  		{
  		if(Count >= 5)
  		{
  		new name;
	  GetPlayerName(playerid, name, sizeof(name));
	  format(string, sizeof(string), "SERVER: %s started countdown.", name );
	  SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  		format(string, sizeof(string), "[1234] %s started countdown", name );
 		printf(string);
  		CountDown();
  		return 1;
  		}
  		else
  		{
  		SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: Countdown is already started.");
  		return 1;
		}
}
Everywhere since it's not in another callback:
Код:
public CountDown(){
if (Count > 0){
GameTextForAll( CountText[Count-1], 2500, 3);
Count--;
SetTimer("CountDown", 1000, 0);
}
else{
GameTextForAll("~r~Go~w~! ~r~Go~w~! ~r~Go~w~!", 2500, 3);
Count = 5;
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)