forward countdown(); public countdown() { if(CountDown==6) SendClientMessageToAll(0xFFFF00AA, ""); CountDown--; if(CountDown==0) { SendClientMessageToAll(0xFFFF00AA, "{FFFF00}Vai {FFFFFF}Vai {FFFF00}Vai"); CountDown = -1; for(new i = 0; i < MAX_PLAYERS; i++) { PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); } return 0; } else { new text[7]; format(text,sizeof(text),"- %d -",CountDown); for(new i = 0; i < MAX_PLAYERS; i++) { PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); } SendClientMessageToAll(0xFFFF00AA, text); } SetTimer("countdown",1000,0); return 0; } |
forward countdown();
public countdown()
{
if (CountDown == 4) SendClientMessageToAll(0xFFFF00AA, "");
CountDown--;
if (CountDown == 0)
{
SendClientMessageToAll(0xFFFF00AA, "{FFFF00}Vai {FFFFFF}Vai {FFFF00}Vai");
CountDown = -1;
for (new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
}
return 0;
}
else
{
new text[7];
format(text, sizeof(text), "- %d -", CountDown);
for (new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
SendClientMessageToAll(0xFFFF00AA, text);
}
SetTimer("countdown", 1000, 0);
return 0;
}
//Countdown===========================================
new Count = 3;
new CountText[3][3] =
{
"3",
"2",
"1"
};//topo
//comando
if (strcmp(cmdtext, "/contar", true)==0){
if(pAdmin[playerid] > 0){
if(Count >= 3){
SendClientMessage(playerid, 0x33AA33AA, "(INFO) Contador й iniciado!");
CountDown();
return 1;
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "(ERRO) Contador jб estб ativado!");
return 1;
}
}
}
forward CountDown();
public CountDown()
{
if (Count > 0)
{
SendClientMessageToAll(0x33AA33AA, CountText[Count-1]);
Count--;
SetTimer("CountDown", 1000, 0);
}
else
{
SendClientMessageToAll(0xFFFF00AA, "{FFFF00}Vai {FFFFFF}Vai {FFFF00}Vai");
Count = 3;
}
return 1;
}