[NEED] IsVehicleNearToPos
#8

All above versions sux, not because they are wrong but because they are damn slow...
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);
}
Usage: IsVehicleToPos(veh, x, y, z, dist)

Have fun
Reply


Messages In This Thread
[NEED] IsVehicleNearToPos - by silvan - 25.09.2009, 10:47
Re: [NEED] IsVehicleNearToPos - by Calgon - 25.09.2009, 10:50
Re: [NEED] IsVehicleNearToPos - by silvan - 25.09.2009, 11:08
Re: [NEED] IsVehicleNearToPos - by virspector - 25.09.2009, 12:43
Re: [NEED] IsVehicleNearToPos - by virspector - 25.09.2009, 12:51
Re: [NEED] IsVehicleNearToPos - by silvan - 25.09.2009, 12:52
Re: [NEED] IsVehicleNearToPos - by Sergei - 25.09.2009, 13:20
Re: [NEED] IsVehicleNearToPos - by Google63 - 25.09.2009, 13:48
Re: [NEED] IsVehicleNearToPos - by Calgon - 25.09.2009, 14:07

Forum Jump:


Users browsing this thread: 1 Guest(s)