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