05.03.2014, 03:11
So I have this code. And I'm looking to start a timer of 10 seconds, warning the players of the round about to start. Everything works, but the last part. I don't receive a message saying "Round starting in 10 seconds", and the timer doesn't start. What's the issue?
pawn Code:
CMD:ready(playerid, params[])
{
if(IsPlayerReady[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_GREY, "Error: You're already ready.");
}
if(GameProgress == 1)
{
return SendClientMessage(playerid,COLOR_GREY, "Error: You can't /ready when a game is in progress.");
}
if(intro[playerid] == 1)
{
return SendClientMessage(playerid,COLOR_GREY, "Error: You can't /ready when in the introduction.");
}
players++;
IsPlayerReady[playerid] = 1;
LobbyCount++;
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
new string[128];
format(string,sizeof(string), "%s is ready to enter the Hunger Games Tournament.",name);
SendClientMessageToAll(COLOR_GREEN, string);
if(LobbyCount > 1 )
{
SendClientMessage(playerid, COLOR_GREEN, "Round starting in 10 seconds. Get ready. (/ready to enter.)");
SetTimer("RoundStartTimer", 10000, false);
}
return 1;
}