Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.56 KB | None | 0 0
  1. #if !defined MAX_MOVE_OBJECT
  2.     #define MAX_MOVE_OBJECT     3
  3. #endif
  4.  
  5. enum e__OBJECT_MOVED_INFO {
  6.  
  7.     gObjectid,
  8.     bool: isMove
  9. }
  10. new ObjectInfo[ MAX_MOVE_OBJECT ][ e__OBJECT_MOVED_INFO ];
  11.  
  12. enum e__OBJECT_ARRAY_INFO {
  13.    
  14.     gmModel,
  15.    
  16.     Float: gmObjectX,
  17.     Float: gmObjectY,
  18.     Float: gmObjectZ,
  19.  
  20.     Float: gmEndX,
  21.     Float: gmEndY,
  22.     Float: gmEndZ,
  23.  
  24. }
  25.  
  26. new array_move_object[ MAX_MOVE_OBJECT ][ e__OBJECT_ARRAY_INFO ] =
  27. {
  28.     {3930, -47.661, 1515.25, 14.451, -930.3621,-1837.6702,90.3852 },
  29.     {3930, -63.22, 1519.28699, 14.451, -930.3621,-1837.6702,90.3852 },
  30.     {3930, -47.156, 1531.86499, 14.451, -930.3621,-1837.6702,90.3852 }
  31.  
  32. };
  33.  
  34.  
  35. public OnFilterScriptInit() {
  36.  
  37.     for(new i; i < MAX_MOVE_OBJECT; i ++) {
  38.  
  39.         ObjectInfo[i][gObjectid] = CreateDynamicObject(
  40.             array_move_object[i][gmModel],
  41.             array_move_object[i][gmObjectX],
  42.             array_move_object[i][gmObjectY],
  43.             array_move_object[i][gmObjectZ],
  44.             0.0, 0.0, 0.0
  45.         );
  46.  
  47.         ObjectInfo[i][isMove] = true;
  48.         MoveDynamicObject(
  49.             ObjectInfo[i][gObjectid],
  50.             array_move_object[i][gmEndX],
  51.             array_move_object[i][gmEndY],
  52.             array_move_object[i][gmEndZ],
  53.             0.2
  54.         );
  55.     }
  56.     return true;
  57. }
  58. public OnDynamicObjectMoved(objectid)
  59. {
  60.     new Float: x, Float: y, Float: z;
  61.  
  62.     for(new i; i < MAX_MOVE_OBJECT; i ++) {
  63.  
  64.         GetDynamicObjectPos(ObjectInfo[i][gObjectid], x, y, z );
  65.         if((ObjectInfo[i][isMove] = !ObjectInfo[i][isMove]))
  66.             MoveDynamicObject(ObjectInfo[i][gObjectid],x,y,z-0.2, 0.2, 0, 0, 180);
  67.         else
  68.             MoveDynamicObject(ObjectInfo[i][gObjectid], x, y, z+0.2, 0.2, 0, 0, 180);
  69.    
  70.     }
  71.     return true;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement