31.05.2011, 17:04
Very simple and awesome countdown!
By: Markx
On top:By: Markx
pawn Код:
new IsCountdownRunning;
#define Blue "{003DF5}"
#define Red "{F5003D}"
#define Green "{3DF500}"
#define White "{FFFFFF}"
#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll
pawn Код:
stock Wait(ms) //Credits to Y_Less
{
ms += GetTickCount();
while (GetTickCount() < ms) {}
}
pawn Код:
CMD:countdown(playerid, params[])
{
new string[128];
if(IsCountdownRunning == 1) return SCM(playerid, -1, ""Red"[Error] "White"Please try again later");
format(string, sizeof(string), ""Green"[System] "White"%s has started the countdown!", GetName(playerid));
SCM(playerid, -1, string);
IsCountdownRunning = 1;
GameTextForAll("~b~3", 1000, 3);
PlaySoundForAll(1056);
Wait(1000);
GameTextForAll("~g~2", 1000, 3);
PlaySoundForAll(1056);
Wait(1000);
GameTextForAll("~y~1", 1000, 3);
PlaySoundForAll(1056);
Wait(1000);
GameTextForAll("~r~G~w~O!", 1000, 3);
PlaySoundForAll(1057);
Wait(10000);
IsCountdownRunning = 0;
return 1;
}

