30.03.2009, 22:58
pawn Код:
//global
new enableCmd[MAX_PLAYERS]; //the toggle variable for us to use
pawn Код:
//OnPlayerEnterCheckpoint
enableCmd[playerid] = 1; //make it possible for player to use the command if he enters the checkpoint
pawn Код:
//OnPlayerExitCheckpoint
enableCmd[playerid] = 0; //make it impossible for player to use the command if he leaves the checkpoint
pawn Код:
//OnPlayerText
if(enableCmd[playerid] && IsPlayerInCheckpoint(playerid))
{
if(!strcmp(text, "1", true))
{
//stuff if player types 1
}
//continue making for the other numbers
}