[ Help ] IsPlayerInArea
#1

Hello.. How to record if(!IsPlayerInArea(playerid, x y z)) cordinates ?
Thx ..
Reply
#2

Replace "IsPlayerInArea" with "IsPlayerInRangeOfPoint"
Reply
#3

I do not want, I will exclusively IsPlayerInArea .. Helppp
Reply
#4

same usage
Reply
#5

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Hello, IsPlayerInArea is used with 4 coordinates

Lower X, Lower Y, Max X, Max Y

Код:
              _________________ Point 2;
             |                |
             |    This is     |
             |  the area that |
             |    you want    |
             |   to define!   |
             |________________|
      Point 1;
Get the coords of Point 1 by /save, then go to the higher corner and /save, then add the X, Y
Point 1;AddStaticVehicle(411,1070.0337,-1270.5579,13.3460,314.2307,79,1); // 1
Point 2;AddStaticVehicle(411,1207.6150,-1158.7721,23.3225,44.6579,79,1); // 2

How to add in IsPlayerInArea ?
Reply
#6

pawn Код:
stock IsPlayerInArea(playerid, Float: MinX, Float: MinY, Float: MaxX, Float: MaxY)
{
    new Float: X, Float: Y, Float: Z;
    return GetPlayerPos(playerid, X, Y, Z) && (MinX < X <= MaxX && MinY < Y <= MaxY);
}
and
pawn Код:
if (IsPlayerInArea(playerid, 1070.0337, -1270.5579, 1207.6150, -1158.7721))
{
    // in area
}
Reply
#7

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Hello, IsPlayerInArea is used with 4 coordinates

Lower X, Lower Y, Max X, Max Y

Код:
              _________________ Point 2;
             |                |
             |    This is     |
             |  the area that |
             |    you want    |
             |   to define!   |
             |________________|
      Point 1;
Get the coords of Point 1 by /save, then go to the higher corner and /save, then add the X, Y
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
stock IsPlayerInArea(playerid, Float: MinX, Float: MinY, Float: MaxX, Float: MaxY)
{
    new Float: X, Float: Y, Float: Z;
    return GetPlayerPos(playerid, X, Y, Z) && (MinX < X <= MaxX && MinY < Y <= MaxY);
}
and
pawn Код:
if (IsPlayerInArea(playerid, 1070.0337, -1270.5579, 1207.6150, -1158.7721))
{
    // in area
}
Код:
   if(!IsPlayerInArea(playerid, 1505.077, -1752.921, 1638.176, -1587.116)) return SCM(playerid, GRAD2, "{FF0000}(greska) {FFFFFF} Ne nalazite se u svojoj bazi!");
I need this but not stock ..
Reply
#8

Remove the stock then but it doesn't matter anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)