SA-MP Forums Archive
Need Help! Areacheck - 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)
+--- Thread: Need Help! Areacheck (/showthread.php?tid=301666)



Need Help! Areacheck - shagy - 05.12.2011

I need help with that it aint working and i compile and it shows no errors help please.

Код HTML:
   forward isPlayerInArea();
   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 <= -1899 && X >= -1874 && Y <= 384 && Y >= 338)
           /* This line is the important one!. Here, is where you change those numbers, by the ones
           you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
           doesnt matter*/
           {
               SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
           }
       }
   }
I just want that if a player gets into a certain area of the map he dies


Re: Need Help! Areacheck - [C]ave[M]an - 05.12.2011

pawn Код:
SetTimer("isPlayerInArea", 1000, 1);
https://sampwiki.blast.hk/wiki/Areacheck


Respuesta: Re: Need Help! Areacheck - shagy - 05.12.2011

Quote:
Originally Posted by [C]ave[M]an
Посмотреть сообщение
pawn Код:
SetTimer("isPlayerInArea", 1000, 1);
https://sampwiki.blast.hk/wiki/Areacheck
Yes already did that... Still didn't work


Re: Respuesta: Re: Need Help! Areacheck - [C]ave[M]an - 05.12.2011

Quote:
Originally Posted by shagy
Посмотреть сообщение
Yes already did that... Still didn't work
You didn't set the positions didn't you?


Respuesta: Re: Respuesta: Re: Need Help! Areacheck - shagy - 05.12.2011

Quote:
Originally Posted by [C]ave[M]an
Посмотреть сообщение
You didn't set the positions didn't you?

SetTimer("IsPlayerInArea", 1000, 1);

you mean add X and Y there? how?


Re: Respuesta: Re: Respuesta: Re: Need Help! Areacheck - [C]ave[M]an - 05.12.2011

Quote:
Originally Posted by shagy
Посмотреть сообщение
SetTimer("IsPlayerInArea", 1000, 1);

you mean add X and Y there? how?
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 <= <here> && X >= <here> && Y <= <here> && Y >= <here>)
           /* This line is the important one!. Here, is where you change those numbers, by the ones
           you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
           doesnt matter*/

           {
               SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
           }
       }
   }
Replace the "<here>"s'