start of function body without function header
#1

This timer I set up is outputting an error, and I'm not sure why. It is forwarded, all the shortened word (like SCM, pid) are all defined, the only thing different from a regular settimer is I gave this one a variable.

Resolution: that tiny semicolon on the header shouldnt be there.

pawn Код:
TIMER_GAMESTART = SetTimer("GameStart", 60000, true);

public GameStart();
{
    if(PlayersConnected >= 3)
    {
        if(GameJoin == true)
        {
            new PlayersReady = 0;
            for(new i=0; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if PlayerReady[i] = true;
                    {
                        PlayersReady++;
                    }
                }
                else continue;
            }
            if(PlayersReady >= 3)
            {
                SCMA(COLOR_GOLD, "The game is starting! All ready tributes will be placed in the arena.");
                GameJoin = false;
                KillTimer(TIMER_GAMESTART);
            }
            else SCMA(COLOR_GREEN, "Not enough tributes were ready.")
        }
        else
        {
            GameJoin = true;
            SCMA(COLOR_GREEN, "The arena is ready. All tributes please ready (/ready) to enter the arena.")
        }
    }
    else SCMA(COLOR_GREEN, "The game was not joinable because there aren't enough tributes online.")
    return 1;
}
Reply
#2

pawn Код:
forward GameStart();

public GameStart()
{
...
   return 1;
}
The semicolon goes on the forward, not the actual callback.

Edit: I didn't realize you fixed it already.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)