open.mp forum
[Pawn] Extended vehicle rotation - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Extended vehicle rotation (/showthread.php?tid=2133)



Extended vehicle rotation - Otakeiro - 2021-06-23

Is there any way to set/get the vehicle rotation like we do with objects?



Example:

? - SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ);

? - GetObjectPos(objectid, &Float:X, &Float:Y, &Float:Z);



Expectation:

? - SetVehicleRot(vehicleid, Float:RotX, Float:RotY, Float:RotZ);

? - GetVehicleRot(vehicleid, &Float:X, &Float:Y, &Float:Z);



I know that 3DTryg has this function but I reject the idea of adding an npc to do this, so any workaround or plugin that meets my expectations I would appreciate it if you share it!


RE: Extended vehicle rotation - Pinch - 2021-06-24

uh, this?
https://open.mp/docs/scripting/functions/GetVehicleRotationQuat

https://sampwiki.blast.hk/wiki/GetVehicleRotation


RE: Extended vehicle rotation - Leonardo - 2021-06-26

https://github.com/Leonardo541/matrix



Functions:

- GetVehicleRot

- SetVehicleRot



Functions in matrix_example.inc, requires amx_assembly and Pawn.RakNet. Compatible with v0.3.7-R2, v0.3.7-R3 and v0.3DL-R1.



Works with unoccupied vehicles and with driver / passengers. To work, there needs to be at least 2 players connected, but that is solved by creating 1 fake npc. Check matrix_example.inc and matrix_example2.pwn files.