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 ![]() |
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
}
}
}
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
}
}
}
Originally Posted by ☮ DjSkca ☼
Quote:
This tutorial is if someone enter's the area, he gets killed, but I need it the other way ![]() |
if(X < -9.7705 || X > 22.9811 || Y < -11.6313 || Y > 21.2981)