• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Extended vehicle rotation
#1
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!
  Reply
#2
uh, this?
https://open.mp/docs/scripting/functions...tationQuat

https://sampwiki.blast.hk/wiki/GetVehicleRotation
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
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.
My nickname in-game is: [L]3O
  Reply


Forum Jump: