Squared area (if(IsPlayerInRangeOfPoint) problem
#4

IsPlayerInRangeOfPoint does not really check for squared areas... It was made to checks for spheres (Notice the range parameter).
But you can easily create a function like:
pawn Код:
stock IsPlayerInSquaredArea(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(minx <= x <= maxx && miny <= y <= maxy) return true;
    else return false;
}
Usage:
pawn Код:
if(IsPlayerInSquaredArea(playerid, 123.123, 234.234, 123.123, 234.234)
SendClientMessage(playerid, -1, "You are inside the squared area");
Or you can use Incognito's streamer.
Reply


Messages In This Thread
Squared area (if(IsPlayerInRangeOfPoint) problem - by davve95 - 14.10.2013, 18:29
Re: Squared area (if(IsPlayerInRangeOfPoint) problem - by VenomMancer - 14.10.2013, 18:40
Re: Squared area (if(IsPlayerInRangeOfPoint) problem - by rickisme - 14.10.2013, 18:41
Re: Squared area (if(IsPlayerInRangeOfPoint) problem - by Dragonsaurus - 14.10.2013, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)