Guest User

Objects Moving

a guest
Aug 23rd, 2010
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.20 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4. #define MOVE_TIME       1000//The interval before the objects will move
  5.  
  6. new Object[2];
  7. new ObjectTimer;
  8. new ObjectPos;
  9.  
  10. public OnFilterScriptInit()
  11. {
  12.     Object[0] = CreateObject(3115, 834.58679199219, -2077.3247070313, 11.756024360657, 0.0, 0.0, 0.0);
  13.     Object[1] = CreateObject(3115, 834.35845947266, -2116.4672851563, 5.5060243606567, 0.0, 0.0, 0.0);
  14.    
  15.     ObjectTimer = SetTimer("ObjectMover", MOVE_TIME, 1);
  16.     return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21.     KillTimer(ObjectTimer);
  22.     return 1;
  23. }
  24.  
  25. forward ObjectMover();
  26. public ObjectMover()
  27. {
  28.     if(ObjectPos == 0)//If the objects are in the 1st position
  29.     {
  30.         MoveObject(Object[0], 834.35845947266, -2116.4672851563, 5.5060243606567, 1.0);
  31.         MoveObject(Object[1], 834.58679199219, -2077.3247070313, 11.756024360657, 1.0);
  32.     }
  33.     else//If the objects are in the 2nd position
  34.     {
  35.         MoveObject(Object[0], 834.58679199219, -2077.3247070313, 11.756024360657, 1.0);
  36.         MoveObject(Object[1], 834.35845947266, -2116.4672851563, 5.5060243606567, 1.0);
  37.     }
  38. }
  39.  
  40. public OnObjectMoved(objectid)//And this function shows us where are the objects (1st/2nd)
  41. {
  42.     if(ObjectPos == 0) ObjectPos = 1;
  43.     else ObjectPos = 0;
  44.     return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment