25.09.2009, 13:48
All above versions sux, not because they are wrong but because they are damn slow...
You better use this:
Usage: IsVehicleToPos(veh, x, y, z, dist)
Have fun
You better use this:
Код:
#define IsToPoint(%0,%1,%2,%3,%4,%5,%6) \ ((((%0) - (%3)) * ((%0) - (%3))) + (((%1) - (%4)) * ((%1) - (%4))) + (((%2) - (%5)) * ((%2) - (%5))) <= ((%6) * (%6))) // ******'s macro for distance checking stock IsVehicleNearPos(weed, Float: x, Float: y, Float: z, Float: dist) { new Float: vX, Float: vY, Float: vZ; GetVehiclePos(weed, vX, vY, vZ); return IsToPoint(x,y,z,vX,vY,vZ,dist); }
Have fun