SA-MP Forums Archive
GetAngleBetweenVehicleAndPoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetAngleBetweenVehicleAndPoint (/showthread.php?tid=519471)



GetAngleBetweenVehicleAndPoint - Oskaar1994 - 14.06.2014

Hey,
does anyone have a function for me which can give me the the Z Angle of a vehicle if it faces a special point. Something like this function but it should be compatible with the Z Angle of the vehicle:
Код:
stock Float:GetAngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2){
    new Float:angle = atan2(y2-y1, x2-x1);
    return angle;
}