05.05.2014, 08:47
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..
And you can check the distance between vehicle and player :3 simply and it's working
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; }