SHARE
TWEET

Untitled

a guest Dec 2nd, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. forward MoveAttachedObject(oid, vid, Float:oX, Float:oY, Float:oZ, Float:orX, Float:orY, Float:orZ, Float:dX, Float:dY, Float:dZ, Float:drX, Float:drY, Float:drZ, Float:speed);
  2. public MoveAttachedObject(oid, vid, Float:oX, Float:oY, Float:oZ, Float:orX, Float:orY, Float:orZ, Float:dX, Float:dY, Float:dZ, Float:drX, Float:drY, Float:drZ, Float:speed)
  3. {
  4.  
  5.     if(!MoveInfo[oid][actif])
  6.     {
  7.         MoveInfo[oid][scale] = DistanceToPoint(oX, oY, oZ, dX, dY, dZ)/speed;
  8.         printf("%f", DistanceToPoint(oX, oY, oZ, dX, dY, dZ));
  9.  
  10.         MoveInfo[oid][gradualeX] = (dX-oX)/(MoveInfo[oid][scale]);
  11.         MoveInfo[oid][gradualeY] = (dY-oY)/(MoveInfo[oid][scale]);
  12.         MoveInfo[oid][gradualeZ] = (dZ-oZ)/(MoveInfo[oid][scale]);
  13.  
  14.         MoveInfo[oid][gradualeRX] = (drX-orX)/(MoveInfo[oid][scale]);
  15.         MoveInfo[oid][gradualeRY] = (drY-orY)/(MoveInfo[oid][scale]);
  16.         MoveInfo[oid][gradualeRZ] = (drZ-orZ)/(MoveInfo[oid][scale]);
  17.        
  18.         MoveInfo[oid][actif] = 1;
  19.  
  20.         SetTimerEx("MoveAttachedObject", 100, false, "ddfffffffffffff", oid, vid, oX+MoveInfo[oid][gradualeX], oY+MoveInfo[oid][gradualeY], oZ+MoveInfo[oid][gradualeZ], orX+MoveInfo[oid][gradualeRX], orY+MoveInfo[oid][gradualeRY],orZ+ MoveInfo[oid][gradualeRZ], dX, dY, dZ, drX, drY, drZ, speed);
  21.     }
  22.     else if(MoveInfo[oid][actif] == 1) // update pos
  23.     {
  24.         if(MoveInfo[oid][scale] >0)
  25.         {
  26.  
  27.             if((MoveInfo[oid][scale]-1.0)>0)
  28.             {
  29.                 MoveInfo[oid][scale]-= 1.0;
  30.                 AttachObjectToVehicle(oid, vid, oX+MoveInfo[oid][gradualeX], oY+MoveInfo[oid][gradualeY], oZ+MoveInfo[oid][gradualeZ], orX+MoveInfo[oid][gradualeRX], orY+MoveInfo[oid][gradualeRY], orZ+ MoveInfo[oid][gradualeRZ]);
  31.                 SetTimerEx("MoveAttachedObject", 100, false, "ddfffffffffffff", oid, vid, oX+MoveInfo[oid][gradualeX], oY+MoveInfo[oid][gradualeY], oZ+MoveInfo[oid][gradualeZ], orX+MoveInfo[oid][gradualeRX], orY+MoveInfo[oid][gradualeRY], orZ+ MoveInfo[oid][gradualeRZ], dX, dY, dZ, drX, drY, drZ, speed);
  32.             }
  33.             else
  34.             {
  35.                 MoveInfo[oid][scale] = 0.0;
  36.                 AttachObjectToVehicle(oid, vid, oX, oY, oZ, orX, orY, orZ);
  37.                 SetTimerEx("MoveAttachedObject", 100, false, "ddfffffffffffff", oid, vid, oX, oY, oZ, orX, orY, orZ, dX, dY, dZ, drX, drY, drZ, speed);
  38.             }
  39.  
  40.         }
  41.         else if(MoveInfo[oid][scale] <= 0) // l'├ęchelle est fini, on attache l'objet a sa position finale
  42.         {
  43.             AttachObjectToVehicle(oid, vid, dX, dY, dZ, drX, drY, drZ);
  44.             MoveInfo[oid][actif] = 0;
  45.         }
  46.     }
  47.     return 0;
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top