Attach Object Rotation Vehicle - 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: Attach Object Rotation Vehicle (
/showthread.php?tid=634282)
Attach Object Rotation Vehicle -
PhamHoang - 16.05.2017
https://www.youtube.com/watch?v=ZZ-C_9autXg
So I saw this video of AbyssMorgan
I look at his code and do not know
Why do this, please help me
Code :
PHP код:
stock CompRotationFloat(Float:rotation,&Float:cr){
cr = rotation;
while(cr < 0.0) cr += 360.0;
while(cr >= 360.0) cr -= 360.0;
}
PHP код:
new Float:angle,Float:vax,Float:va;
GetVehicleZAngle(GetPlayerVehicleID(playerid), va);
GetPlayerCameraZAngle(playerid,angle);
CompRotationFloat(angle-va+90,vax);
AttachDynamicObjectToVehicle(alobj,GetPlayerVehicleID(playerid),0.0,0.0,0.1,0.0,0.0,vax);
Why we need angle-va+90?
Re: Attach Object Rotation Vehicle -
PhamHoang - 17.05.2017
bump
Re: Attach Object Rotation Vehicle -
PhamHoang - 17.05.2017
help me
Re: Attach Object Rotation Vehicle -
AbyssMorgan - 17.05.2017
CompRotationFloat - Compress rotation to value in range <0.0:360.0)