Animated Rotation?
#11

Quote:
Originally Posted by yugokoral
And how can i stop the timer, when the object is in right position?
pawn Код:
forward rotation(); // The call back Timer.
new rottimer; //Timer

public OnGameModeInit()
{
   rottimer = SetTimer("rotation", 100, 1); // The timer which will go off every millisecond.
   object = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); // The object (Fill in the spaces)
   return 1;
}

public rotation() // The callback
{
   new Float:rotx, Float:roty, Float:rotz; //Floats
   SetObjectRot(object, 0, 0, +0.1); // Will set the Z rot +0.1 every millisecond
   GetObjectRot(object, rotx, roty, rotz)// Checks the pos
   if(rotz == 100.0) KillTimer(rottimer); //Checks if the z rot is 100.0 and kills the timer if it is.
   return 1;
}
Reply


Messages In This Thread
Animated Rotation? - by Flibber100 - 09.05.2008, 14:16
Re: Animated Rotation? - by Snickers - 09.05.2008, 14:18
Re: Animated Rotation? - by Giacomand - 09.05.2008, 14:24
Re: Animated Rotation? - by Carlos_Leone - 09.05.2008, 14:55
Re: Animated Rotation? - by Snickers - 09.05.2008, 14:55
Re: Animated Rotation? - by Flibber100 - 09.05.2008, 15:52
Re: Animated Rotation? - by Giacomand - 09.05.2008, 16:09
Re: Animated Rotation? - by mini_tomo_2 - 09.05.2008, 16:13
Re: Animated Rotation? - by Yaheli_Faro - 09.05.2008, 16:15
Re: Animated Rotation? - by yugokoral - 29.10.2008, 12:53
Re: Animated Rotation? - by Finn - 29.10.2008, 13:19
Re: Animated Rotation? - by yugokoral - 29.10.2008, 13:43
Re: Animated Rotation? - by Finn - 29.10.2008, 14:16
Re: Animated Rotation? - by yugokoral - 29.10.2008, 15:41
Re: Animated Rotation? - by Finn - 29.10.2008, 15:51
Re: Animated Rotation? - by yugokoral - 29.10.2008, 16:29
Re: Animated Rotation? - by Finn - 29.10.2008, 16:44
Re: Animated Rotation? - by yugokoral - 29.10.2008, 17:11
Re: Animated Rotation? - by Finn - 29.10.2008, 17:20
Re: Animated Rotation? - by yugokoral - 29.10.2008, 17:27
Re: Animated Rotation? - by yugokoral - 29.10.2008, 17:32
Re: Animated Rotation? - by LTomi - 26.02.2009, 15:52
Re: Animated Rotation? - by LTomi - 27.02.2009, 12:53

Forum Jump:


Users browsing this thread: 4 Guest(s)