Credits to 2KY for making this.
pawn Код:
#include <a_samp>
new
p_Countdown[MAX_PLAYERS] = 30;
forward CountingDown(playerid);
public CountingDown(playerid)
{
switch(p_Countdown[playerid])
{
case 30: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 29: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 28: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 27: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 26: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 25: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 24: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 23: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 22: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 21: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 20: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 19: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 18: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 17: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 16: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 15: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 14: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 13: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 12: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 11: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 10: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 9: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 8: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 7: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 6: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 5: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 4: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 3: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 2: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 1: {
GameTextForPlayer(playerid, p_Countdown[playerid], 3, 1000), p_Countdown[playerid]--;
}
case 0: //The end.
{
GameTextForPlayer(playerid, "~g~Go!", 3, 100);
p_Countdown[playerid] = 30;
TogglePlayerControllable(playerid, 1); //Unfreeze them.
SendClientMessage(playerid, 0xFFFFFFFF, "Go!");
}
}
p_Countdown[playerid]--;
return true;
}
//Put this in your command to start this.
SetTimerEx("CountingDown", 1000, true, "i", playerid);