Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // "SmoothRotation" 1.l was scripted by Lavamike (Idea and Version 1.0) & ~AWESOME~ (Updating)
- #include <a_samp>
- #include <a_objects>
- #define IsObjectRotating(%1) IsRotating[%1]
- new RotateTimer[MAX_OBJECTS];
- new bool:IsRotating[MAX_OBJECTS];
- stock StartRotateObject(objectid)
- {
- if(!IsValidObject(objectid))
- {
- printf("Object(%i) Doesn't Exist! - Aborting Rotation!",objectid);
- }
- else // It's valid
- {
- RotateTimer[objectid] = SetTimerEx("RotateObject",65,true,"d",objectid);
- IsRotating[objectid] = true;
- return 1;
- }
- return 1;
- }
- stock StopRotateObject(objectid)
- {
- if(!IsValidObject(objectid))
- {
- printf("Object(%i) Doesn't Exist! - Aborting!",objectid);
- }
- else
- {
- KillTimer(RotateTimer[objectid]);
- IsRotating[objectid] = false;
- return 1;
- }
- return 1;
- }
- Public:RotateObject(objectid)
- {
- new Float:X_Rot, Float:Y_Rot, Float:Z_Rot;
- GetObjectRot(objectid,X_Rot,Y_Rot,Z_Rot);
- SetObjectRot(objectid, X_Rot, Y_Rot, Z_Rot += 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment