Guest User

rotate.inc

a guest
Mar 19th, 2011
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.98 KB | None | 0 0
  1. // "SmoothRotation" 1.l was scripted by Lavamike (Idea and Version 1.0) & ~AWESOME~ (Updating)
  2.  
  3. #include <a_samp>
  4. #include <a_objects>
  5.  
  6. #define IsObjectRotating(%1) IsRotating[%1]
  7.  
  8. new RotateTimer[MAX_OBJECTS];
  9. new bool:IsRotating[MAX_OBJECTS];
  10.  
  11. stock StartRotateObject(objectid)
  12. {
  13.     if(!IsValidObject(objectid))
  14.     {
  15.         printf("Object(%i) Doesn't Exist! - Aborting Rotation!",objectid);
  16.     }
  17.     else // It's valid
  18.     {
  19.         RotateTimer[objectid] = SetTimerEx("RotateObject",65,true,"d",objectid);
  20.         IsRotating[objectid] = true;
  21.         return 1;
  22.     }
  23.     return 1;
  24. }
  25.  
  26. stock StopRotateObject(objectid)
  27. {
  28.     if(!IsValidObject(objectid))
  29.     {
  30.         printf("Object(%i) Doesn't Exist! - Aborting!",objectid);
  31.     }
  32.     else
  33.     {
  34.         KillTimer(RotateTimer[objectid]);
  35.         IsRotating[objectid] = false;
  36.         return 1;
  37.     }
  38.     return 1;
  39. }
  40.  
  41.  
  42. Public:RotateObject(objectid)
  43. {
  44.     new Float:X_Rot, Float:Y_Rot, Float:Z_Rot;
  45.     GetObjectRot(objectid,X_Rot,Y_Rot,Z_Rot);
  46.     SetObjectRot(objectid, X_Rot, Y_Rot, Z_Rot += 5);
  47. }
Advertisement
Add Comment
Please, Sign In to add comment