22.02.2009, 20:15
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
}
}
}
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
}
}
}
Simple math anyways try them one of them should work,
well actually they both should :P
Good Luck