An easier way?
#1

OK, I want to set world bounds to players in a non-rectangular map.. It is like two rectangles on top of another bot one goes to the left, one to the right...

Something like this

I want to save the trouble by getting the players position when he is in between them.. etc.. so is there an easier way?

If not, how do i get if a player is in between 4 points on a graph(map)..

Something like this


Which is a tilted figure.. this would help me on making it easier..

I can't think of anything right now.. I am too tired..
Regards.
Reply
#2

You cant set world bounds in non-rectangular map.

ANd if you need how to get minx,maxx,miny and maxy look here:
Код:
Pos1========Pos2
 ||          ||
 ||          ||
 ||          ||
Pos3========Pos4
Pos 1 = Min X and Max Y
Pos 2 = Max X and Max Y
Pos 3 = Min X and Min Y
Pos 4 = Max X and Min Y
Reply
#3

pawn Код:
isPlayerInArea2(playerID, Float:data[4])
{
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerID, X, Y, Z);
            if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) {
                return 1;
            }
    return 0;
}
use on eg this kind of data:
pawn Код:
{-36.5483,-57.9948, -17.2655,-49.2967},
//MinX, MaxX, MinY, MaxY
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)