[HELP] timers
#6

Here, I'll show you an example:

Put this under OnGameModeInit:

pawn Код:
new bool:PlayerInGame[MAX_PLAYERS] = false;
Then when you want the player's 5 minute timer to start put this:

pawn Код:
SetTimerEx("GameOver", 300000, false, "d", playerid);
PlayerInGame[playerid] = true;
Then your OnPlayerEnter Checkpoint should look something like this:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerInGame[playerid])
    {
        SendClientMessage(i, AAD_COLOR_RED, "Well done You have made it before the 5 minutes!!");
        /// Do Something here
    }
    else
    {
        SendClientMessage(i, AAD_COLOR_RED, "You're too late!");
    }
    return 1;
}
and put this somewhere in your script (outside any commands and callbacks), like right at the bottom of your script:

pawn Код:
public GameOver(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, "Game Over Bitch - You're 5 Minutes are up, too bad :P");
    PlayerInGame[playerid] = false;
    //// Do Something here to punish the player or whatever when his time is up.
    return 1;
}

Reply


Messages In This Thread
[HELP] timers - by argon - 26.07.2009, 16:55
Re: [HELP] timers - by Born2die - 26.07.2009, 16:59
Re: [HELP] timers - by James_Alex - 26.07.2009, 16:59
Re: [HELP] timers - by argon - 26.07.2009, 17:01
Re: [HELP] timers - by argon - 26.07.2009, 17:09
Re: [HELP] timers - by member - 26.07.2009, 17:12
Re: [HELP] timers - by argon - 26.07.2009, 17:15
Re: [HELP] timers - by argon - 26.07.2009, 18:09
Re: [HELP] timers - by member - 26.07.2009, 18:17

Forum Jump:


Users browsing this thread: 2 Guest(s)