Hay Area
#4

pawn Код:
public isPlayerInArea()
  {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
      GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
      if ( X <= 'YourX' && X >= 'YourX' && Y <= 'YourY' && Y >= 'YourY' ) {
        // Do Nothing
      } else {
        SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
      }
    }
  }
Or you could go a lil more advance and mess with the signs

pawn Код:
public isPlayerInArea()
  {
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
      GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
      if ( X >= 'YourX' && X <= 'YourX' && Y >= 'YourY' && Y <= 'YourY' ) {
        SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
      }
    }
  }
Thats why i said do you have a brain

Simple math anyways try them one of them should work,
well actually they both should :P

Good Luck
Reply


Messages In This Thread
Hay Area - by Synkro93 - 22.02.2009, 19:34
Re: Hay Area - by JaYmE - 22.02.2009, 19:44
Re: Hay Area - by Synkro93 - 22.02.2009, 19:56
Re: Hay Area - by JaYmE - 22.02.2009, 20:15
Re: Hay Area - by Backwardsman97 - 22.02.2009, 20:16
Re: Hay Area - by Synkro93 - 22.02.2009, 21:59

Forum Jump:


Users browsing this thread: 1 Guest(s)