Hay Area
#1

I still haven't figured out how to make it, so I ask you to help me.
I need an area at the haystack, so if anyone leaves it, then he gets killed.
min = -9.7705, -11.6313
max = 22.9811, 21.2981

Thanks for all your support
Reply
#2

You have the cords,
i hope you have the brains,
oh and... https://sampwiki.blast.hk/wiki/Areacheck has the answers
Reply
#3

Quote:
Originally Posted by JaYmE
You have the cords,
i hope you have the brains,
oh and... https://sampwiki.blast.hk/wiki/Areacheck has the answers
I already saw it.
This tutorial is if someone enter's the area, he gets killed, but I need it the other way
Reply
#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
#5

Quote:
Originally Posted by ☮ DjSkca ☼
Quote:
Originally Posted by JaYmE
You have the cords,
i hope you have the brains,
oh and... https://sampwiki.blast.hk/wiki/Areacheck has the answers
I already saw it.
This tutorial is if someone enter's the area, he gets killed, but I need it the other way
Then just reverse it.

pawn Код:
if(X < -9.7705 || X > 22.9811 || Y < -11.6313 || Y > 21.2981)
Edit:Beat me
Reply
#6

Thank you both, I am going to try em.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)