SA-MP Forums Archive
Hay Area - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hay Area (/showthread.php?tid=66536)



Hay Area - Synkro93 - 22.02.2009

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


Re: Hay Area - JaYmE - 22.02.2009

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


Re: Hay Area - Synkro93 - 22.02.2009

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


Re: Hay Area - JaYmE - 22.02.2009

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


Re: Hay Area - Backwardsman97 - 22.02.2009

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


Re: Hay Area - Synkro93 - 22.02.2009

Thank you both, I am going to try em.