Vehicle Range Problems
#10

He was actualy taking about this..
So the right form of Pythagorean Theorem is x*x + y*y = z*z (math example)
But, I think it would be better to do something like checking the distance from vehicle with form..

Код:
stock CheckPlayerDistanceToVehicle(Float:radi, playerid, vehicleid)
{
	if(IsPlayerConnected(playerid))
	{
	    new Float:PX1,Float:PY1,Float:PZ1,Float:X1,Float:Y1,Float:Z1;
	    GetPlayerPos(playerid,PX1,PY1,PZ1);
	    GetVehiclePos(vehicleid, X1,Y1,Z1);
	    new Float:Distance = (X1-PX1)*(X1-PX1)+(Y1-PY1)*(Y1-PY1)+(Z1-PZ1)*(Z1-PZ1);
	    if(Distance <= radi*radi)
	    {
	        return 1;
	    }
	}
	return 0;
}
And you can check the distance between vehicle and player :3 simply and it's working
Reply


Messages In This Thread
Vehicle Range Problems - by Jack_Leslie - 30.04.2012, 05:35
Re: Vehicle Range Problems - by warcodes_ - 30.04.2012, 05:42
Re: Vehicle Range Problems - by Jack_Leslie - 30.04.2012, 05:44
Re: Vehicle Range Problems - by warcodes_ - 30.04.2012, 05:46
Re: Vehicle Range Problems - by ViniBorn - 30.04.2012, 06:05
Re: Vehicle Range Problems - by warcodes_ - 30.04.2012, 06:19
Re: Vehicle Range Problems - by ViniBorn - 30.04.2012, 06:21
Re: Vehicle Range Problems - by Georgi166 - 30.04.2012, 06:24
Re: Vehicle Range Problems - by warcodes_ - 30.04.2012, 06:24
Re: Vehicle Range Problems - by LusiGzone - 05.05.2014, 08:47

Forum Jump:


Users browsing this thread: 1 Guest(s)