15.01.2014, 12:35
pawn Код:
forward CountDown();
public CountDown()
{
new str[32];
if(CountDownTimes > 1)
{
CountDownTimes --;
format(str, sizeof(str), "~b~Count Down: ~r~%d", CountDownTimes);
GameTextForAll(str, 1000, 6);
SetTimer("CountDown",1000,0);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 5201, 0.0, 0.0, 0.0);
}
}
else if(CountDownTimes <= 1)
{
CountDownTimes = 0;
format(str, sizeof(str), "~y~GO!");
GameTextForAll(str, 1000, 6);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
return 1;
pawn Код:
if(strcmp(cmdtext, "/countdown", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
if(CountDownTimes != 0) return SendErrorMessage(playerid,"A countdown in progress!");
CountDownTimes = 6;
SetTimer("CountDown",500,0);
return 1;
}