function for to check 2 points ( area )
#1

Hello,

I need to help.

I have 2 coords: X Y Z = A and X1 Y2 Z2 = B

I want to check if( X Y Z AND X1 Y2 Z2 AND range < 50) so if A and B are close ( < 50 )
I don't want to call the playerid.


Regards.
Reply
#2

There's a (custom) function to check the distance between two points -Just found it via ******; did you search before asking?-
pawn Код:
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
    return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );
}
So, for what you want you could add this:

pawn Код:
stock IsPointNearPoint(Float:aX, Float:aY, Float:aZ, Float:bX, Float:bY, Float:bZ, range = 50)
    return GetDistance(aX, aY, aZ, bX, bY, bZ) <= range;
Don't forget to add GetDistance aswell then!
Reply
#3

thanks I know but I don't remember regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)