Rotating objects?
#1

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

A timer?
Reply
#3

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
Reply
#4

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

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...
Reply
#6

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

Ellie
Reply
#7

Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)