15.11.2014, 19:26
There's a (custom) function to check the distance between two points -Just found it via ******; did you search before asking?-
So, for what you want you could add this:
Don't forget to add GetDistance aswell then!
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 ) ) ) ) );
}
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;