Spining object like a pickup
#1

Hello everyone,

I've tried adding weapon pickups to an island pretty far from the main map.
At a certain point the pickups stop working, so I figured to use objects instead and rotate them using MoveObject.
Does anyone know how to rotate an object infinitely like a pickup? Like what parameters I need to use in MoveObject?

Thanks in advance.
Reply
#2

Код:
// Create the object at the center of San Andreas [just used for example]
new eg_obj = CreateObject(1234, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);

// Rotate the object by 180 degrees on the z axis
MoveObject(eg_obj, 0, 0, 3+0.0001, 0.0001, 0.0, 0.0, 180.0);
now I think you could move the object its Z rotation to "cellmax", I never used it so I don't know if it works, you could try it out?

Код:
new eg_obj = CreateObject(1234, x, y, z, 0.0, 0.0, 0.0);
MoveObject(eg_obj, x, y, z+0.0001, 0.0001, 0.0, 0.0, cellmax);
Orr you could make a looping timer that keeps adding +360 degrees to the Z axis?

taken from:
https://sampforum.blast.hk/showthread.php?tid=295590
Reply
#3

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Код:
// Create the object at the center of San Andreas [just used for example]
new eg_obj = CreateObject(1234, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);

// Rotate the object by 180 degrees on the z axis
MoveObject(eg_obj, 0, 0, 3+0.0001, 0.0001, 0.0, 0.0, 180.0);
now I think you could move the object its Z rotation to "cellmax", I never used it so I don't know if it works, you could try it out?

Код:
new eg_obj = CreateObject(1234, x, y, z, 0.0, 0.0, 0.0);
MoveObject(eg_obj, x, y, z+0.0001, 0.0001, 0.0, 0.0, cellmax);
Orr you could make a looping timer that keeps adding +360 degrees to the Z axis?

taken from:
https://sampforum.blast.hk/showthread.php?tid=295590
I tried the first method of cellmax, but that resulted in the objects just rotating a tiny bit and then stopping.
The timer did the job though, I've let it rotate 90 degrees every half of a second, and it rotates just fine.
Thanks for the help!
Reply
#4

I wouldn't use a Timer when you can use this callback https://sampwiki.blast.hk/wiki/OnObjectMoved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)