SA-MP Forums Archive
Send players into arena after 2+ players are ready. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Send players into arena after 2+ players are ready. (/showthread.php?tid=498761)



Send players into arena after 2+ players are ready. - rangerxxll - 05.03.2014

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;
}



Re: Send players into arena after 2+ players are ready. - ]Rafaellos[ - 05.03.2014

The message is going to be sent to the player that typed /ready.


Re: Send players into arena after 2+ players are ready. - rangerxxll - 05.03.2014

EDIT: fixed.