SA-MP Forums Archive
Rotating objects? - 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: Rotating objects? (/showthread.php?tid=263975)



Rotating objects? - Markx - 24.06.2011

Is there a function which would rotate the object all the time? in circle. I saw it on a server, but dunno the function...


Re: Rotating objects? - Mean - 24.06.2011

A timer?


Re: Rotating objects? - alpha500delta - 24.06.2011

There's an include for that I believe, it's somewhere on the forums...

Anyway, here are some:

https://sampforum.blast.hk/showthread.php?tid=151452
https://sampforum.blast.hk/showthread.php?tid=75493
https://sampforum.blast.hk/showthread.php?tid=85841


Re: Rotating objects? - Markx - 24.06.2011

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Cheers mate!


Re: Rotating objects? - Buzzbomb - 25.10.2011

heh I done that rotating objects a few weeks ago it was epic Used a Road.. and It was set to stop for 5 seconds before taking off again and Before i got the timing right it stopped before i even got 1/4 of the road it took off It was Awesome...


Re: Rotating objects? - Ely - 25.10.2011

Use this function https://sampwiki.blast.hk/wiki/SetTimer

Ellie


Re: Rotating objects? - Falco-Ger - 25.10.2011

Код:
forward RotateMyObject();

OnGameModeInit()
{
  [...]
  SetTimer("RotateMyObject", 10, true);
  //call rotatemyobject every 10 milliseconds, might wanna save the timer if you want to stop this someday
  [...]
}
public RotateMyObject()
{
  new Float:rx, Float:ry, Float:rz;
  GetObjectRot(yourObjectID, rx, ry, rz);
  rz += 0.2; //how fast you wanna turn it every 10 ms
  if (rz >= 360)
    rz -= 360;
  SetObjectRot(yourObjectID, rx, ry, rz);
  return 1;
}