Hi!
As you know get_distance calculates the distance(units) between 2 X, Y and Z.
It returns the units between them. But let's say you only want to calculate the origins which is the furthest from each other.
In this example, let's say the 2 X origins are furthest from each other.
How to calculate the distance in units between them and don't include the 2 Y and Z origins??
This is just how It could look(illustration), but I want it in small language of course, not C#.
PHP Code:
static cell AMX_NATIVE_CALL get_distance_x(AMX *amx, cell *params)
{
cell *cpVec1 = get_amxaddr(amx, params[1]);
cell *cpVec2 = get_amxaddr(amx, params[2]);
Vector vec1 = Vector((float)cpVec1[X]);
Vector vec2 = Vector((float)cpVec2[X]);
int iDist = (int)((vec1 - vec2).Length());
return iDist;
}
__________________