SHARE
TWEET

convertible script 0.8 pillhead2007

a guest Aug 22nd, 2014 285 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. //---[Keys]
  4. #define HOLDING(%0) \
  5.         ((newkeys & (%0)) == (%0))
  6. #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  7. #define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))
  8.  
  9. forward MoveConvertibleRoofDown(playerid);MoveConvertibleRoofDown1(playerid);
  10. forward MoveConvertibleRoofDown2(playerid);MoveConvertibleRoofDown3(playerid);
  11. forward MoveConvertibleRoofDown4(playerid);MoveConvertibleRoofDown5(playerid);
  12. forward MoveConvertibleRoofDown6(playerid);forward MoveConvertibleRoofDown7(playerid);
  13. forward MoveConvertibleRoofDown8(playerid);forward MoveConvertibleRoofDown9(playerid);
  14. forward MoveConvertibleRoofDown10(playerid);forward MoveConvertibleRoofDown11(playerid);
  15. forward MoveConvertibleRoofDown12(playerid);forward MoveConvertibleRoofUp(playerid);
  16. forward MoveConvertibleRoofUp1(playerid);forward MoveConvertibleRoofUp2(playerid);
  17. forward MoveConvertibleRoofUp3(playerid);forward MoveConvertibleRoofUp4(playerid);
  18. forward MoveConvertibleRoofUp5(playerid);forward MoveConvertibleRoofUp6(playerid);
  19. forward MoveConvertibleRoofUp7(playerid);forward MoveConvertibleRoofUp8(playerid);
  20. forward MoveConvertibleRoofUp9(playerid);forward MoveConvertibleRoofUp10(playerid);
  21. forward MoveConvertibleRoofUp11(playerid);forward MoveConvertibleRoofUp12(playerid);
  22.  
  23. //---[Vehicles]
  24. //--[Enums]
  25. enum vInfo
  26. {
  27.   Convertible,
  28. }
  29. new VehicleInfo[MAX_VEHICLES][vInfo];
  30. new ConvertibleRoof[MAX_VEHICLES];
  31.  
  32. public MoveConvertibleRoofDown(playerid)
  33. {
  34.   new Float:Pos[3];
  35.   new vehicleid = GetPlayerVehicleID(playerid);
  36.   new modelid = GetVehicleModel(vehicleid);
  37.   switch(modelid)
  38.   {
  39.         case 536:
  40.         {
  41.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  42.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1], Pos[2], 2.0, 0, 0, 0);
  43.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1], Pos[2], 0.0, 0.0, 0.0);
  44.       SetTimer("MoveConvertibleRoofDown1", 100, 0);
  45.         }
  46.         case 567:
  47.         {
  48.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  49.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]+0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  50.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]+0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  51.       SetTimer("MoveConvertibleRoofDown1", 100, 0);
  52.     }
  53.   }
  54.   return 1;
  55. }
  56. public MoveConvertibleRoofDown1(playerid)
  57. {
  58.   new Float:Pos[3];
  59.   new vehicleid = GetPlayerVehicleID(playerid);
  60.  
  61.   new modelid = GetVehicleModel(vehicleid);
  62.   switch(modelid)
  63.   {
  64.         case 536:
  65.         {
  66.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  67.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.1, Pos[2], 2.0, 0, 0, 0);
  68.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.1, Pos[2], 0.0, 0.0, 0.0);
  69.       SetTimer("MoveConvertibleRoofDown2", 100, 0);
  70.         }
  71.         case 567:
  72.         {
  73.           GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  74.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]+0.2, Pos[2]-0.25, 2.0, 0, 0, 0);
  75.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]+0.2, Pos[2]-0.25, 0.0, 0.0, 0.0);
  76.       SetTimer("MoveConvertibleRoofDown2", 100, 0);
  77.     }
  78.   }
  79.   return 1;
  80. }
  81. public MoveConvertibleRoofDown2(playerid)
  82. {
  83.   new Float:Pos[3];
  84.   new vehicleid = GetPlayerVehicleID(playerid);
  85.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  86.   new modelid = GetVehicleModel(vehicleid);
  87.   switch(modelid)
  88.   {
  89.     case 536:
  90.         {
  91.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  92.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.2, Pos[2], 2.0, 0, 0, 0);
  93.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.2, Pos[2], 0.0, 0.0, 0.0);
  94.       SetTimer("MoveConvertibleRoofDown3", 100, 0);
  95.         }
  96.         case 567:
  97.         {
  98.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.1, Pos[2]-0.25, 2.0, 0, 0, 0);
  99.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.1, Pos[2]-0.25, 0.0, 0.0, 0.0);
  100.       SetTimer("MoveConvertibleRoofDown3", 100, 0);
  101.     }
  102.   }
  103.   return 1;
  104. }
  105. public MoveConvertibleRoofDown3(playerid)
  106. {
  107.   new Float:Pos[3];
  108.   new vehicleid = GetPlayerVehicleID(playerid);
  109.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  110.   new modelid = GetVehicleModel(vehicleid);
  111.   switch(modelid)
  112.   {
  113.     case 536:
  114.         {
  115.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  116.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.4, Pos[2], 2.0, 0, 0, 0);
  117.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.4, Pos[2], 0.0, 0.0, 0.0);
  118.       SetTimer("MoveConvertibleRoofDown4", 100, 0);
  119.         }
  120.         case 567:
  121.         {
  122.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  123.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  124.       SetTimer("MoveConvertibleRoofDown4", 100, 0);
  125.     }
  126.   }
  127.   return 1;
  128. }
  129. public MoveConvertibleRoofDown4(playerid)
  130. {
  131.   new Float:Pos[3];
  132.   new vehicleid = GetPlayerVehicleID(playerid);
  133.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  134.   new modelid = GetVehicleModel(vehicleid);
  135.   switch(modelid)
  136.   {
  137.     case 536:
  138.         {
  139.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  140.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.5, Pos[2], 2.0, 0, 0, 0);
  141.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.5, Pos[2], 0.0, 0.0, 0.0);
  142.       SetTimer("MoveConvertibleRoofDown5", 100, 0);
  143.         }
  144.         case 567:
  145.         {
  146.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.5, Pos[2]-0.25, 2.0, 0, 0, 0);
  147.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.5, Pos[2]-0.25, 0.0, 0.0, 0.0);
  148.       SetTimer("MoveConvertibleRoofDown5", 100, 0);
  149.     }
  150.   }
  151.   return 1;
  152. }
  153. public MoveConvertibleRoofDown5(playerid)
  154. {
  155.   new Float:Pos[3];
  156.   new vehicleid = GetPlayerVehicleID(playerid);
  157.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  158.   new modelid = GetVehicleModel(vehicleid);
  159.   switch(modelid)
  160.   {
  161.     case 536:
  162.         {
  163.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  164.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.7, Pos[2], 2.0, 0, 0, 0);
  165.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.7, Pos[2], 0.0, 0.0, 0.0);
  166.       SetTimer("MoveConvertibleRoofDown6", 100, 0);
  167.         }
  168.         case 567:
  169.         {
  170.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.7, Pos[2]-0.25, 2.0, 0, 0, 0);
  171.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.7, Pos[2]-0.25, 0.0, 0.0, 0.0);
  172.       SetTimer("MoveConvertibleRoofDown6", 100, 0);
  173.     }
  174.   }
  175.   return 1;
  176. }
  177. public MoveConvertibleRoofDown6(playerid)
  178. {
  179.   new Float:Pos[3];
  180.   new vehicleid = GetPlayerVehicleID(playerid);
  181.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  182.   new modelid = GetVehicleModel(vehicleid);
  183.   switch(modelid)
  184.   {
  185.     case 536:
  186.         {
  187.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  188.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.8, Pos[2], 2.0, 0, 0, 0);
  189.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.8, Pos[2], 0.0, 0.0, 0.0);
  190.       SetTimer("MoveConvertibleRoofDown7", 100, 0);
  191.         }
  192.         case 567:
  193.         {
  194.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.8, Pos[2]-0.25, 2.0, 0, 0, 0);
  195.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.25, 0.0, 0.0, 0.0);
  196.       SetTimer("MoveConvertibleRoofDown7", 100, 0);
  197.     }
  198.   }
  199.   return 1;
  200. }
  201. public MoveConvertibleRoofDown7(playerid)
  202. {
  203.   new Float:Pos[3];
  204.   new vehicleid = GetPlayerVehicleID(playerid);
  205.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  206.   new modelid = GetVehicleModel(vehicleid);
  207.   switch(modelid)
  208.   {
  209.     case 536:
  210.         {
  211.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  212.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.10, 2.0, 0, 0, 0);
  213.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.10, 0.0, 0.0, 0.0);
  214.       SetTimer("MoveConvertibleRoofDown8", 100, 0);
  215.         }
  216.         case 567:
  217.         {
  218.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.26, 2.0, 0, 0, 0);
  219.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.26, 0.0, 0.0, 0.0);
  220.       SetTimer("MoveConvertibleRoofDown8", 100, 0);
  221.     }
  222.   }
  223.   return 1;
  224. }
  225. public MoveConvertibleRoofDown8(playerid)
  226. {
  227.   new Float:Pos[3];
  228.   new vehicleid = GetPlayerVehicleID(playerid);
  229.   new modelid = GetVehicleModel(vehicleid);
  230.   switch(modelid)
  231.   {
  232.     case 536:
  233.         {
  234.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  235.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.20, 2.0, 0, 0, 0);
  236.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.20, 0.0, 0.0, 0.0);
  237.       SetTimer("MoveConvertibleRoofDown9", 100, 0);
  238.         }
  239.         case 567:
  240.         {
  241.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.30, 2.0, 0, 0, 0);
  242.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.30, 0.0, 0.0, 0.0);
  243.       SetTimer("MoveConvertibleRoofDown9", 100, 0);
  244.     }
  245.   }
  246.   return 1;
  247. }
  248. public MoveConvertibleRoofDown9(playerid)
  249. {
  250.   new Float:Pos[3];
  251.   new vehicleid = GetPlayerVehicleID(playerid);
  252.  
  253.   new modelid = GetVehicleModel(vehicleid);
  254.   switch(modelid)
  255.   {
  256.     case 536:
  257.         {
  258.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  259.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.35, 2.0, 0, 0, 0);
  260.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.35, 0.0, 0.0, 0.0);
  261.       SetTimer("MoveConvertibleRoofDown10", 100, 0);
  262.         }
  263.         case 567:
  264.         {
  265.           GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  266.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.40, 2.0, 0, 0, 0);
  267.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.40, 0.0, 0.0, 0.0);
  268.       SetTimer("MoveConvertibleRoofDown10", 100, 0);
  269.         }
  270.   }
  271.   return 1;
  272. }
  273. public MoveConvertibleRoofDown10(playerid)
  274. {
  275.   new Float:Pos[3];
  276.   new vehicleid = GetPlayerVehicleID(playerid);
  277.   new modelid = GetVehicleModel(vehicleid);
  278.   switch(modelid)
  279.   {
  280.     case 536:
  281.         {
  282.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  283.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.50, 2.0, 0, 0, 0);
  284.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.50, 0.0, 0.0, 0.0);
  285.       SetTimer("MoveConvertibleRoofDown11", 100, 0);
  286.         }
  287.         case 567:
  288.         {
  289.           GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  290.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.50, 2.0, 0, 0, 0);
  291.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.50, 0.0, 0.0, 0.0);
  292.       SetTimer("MoveConvertibleRoofDown11", 100, 0);
  293.         }
  294.   }
  295.   return 1;
  296. }
  297. public MoveConvertibleRoofDown11(playerid)
  298. {
  299.   new Float:Pos[3];
  300.   new vehicleid = GetPlayerVehicleID(playerid);
  301.   new modelid = GetVehicleModel(vehicleid);
  302.   switch(modelid)
  303.   {
  304.     case 536:
  305.         {
  306.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  307.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.60, 2.0, 0, 0, 0);
  308.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.60, 0.0, 0.0, 0.0);
  309.       SetTimer("MoveConvertibleRoofDown12", 100, 0);
  310.         }
  311.         case 567:
  312.         {
  313.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  314.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.60, 2.0, 0, 0, 0);
  315.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.60, 0.0, 0.0, 0.0);
  316.       SetTimer("MoveConvertibleRoofDown12", 100, 0);
  317.         }
  318.   }
  319.   return 1;
  320. }
  321. public MoveConvertibleRoofDown12(playerid)
  322. {
  323.   new Float:Pos[3];
  324.   new vehicleid = GetPlayerVehicleID(playerid);
  325.   new modelid = GetVehicleModel(vehicleid);
  326.   switch(modelid)
  327.   {
  328.     case 536:
  329.         {
  330.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  331.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.70, 2.0, 0, 0, 0);
  332.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.70, 0.0, 0.0, 0.0);
  333.       SetTimer("CloseBootRoof", 5, 0);
  334.       DestroyObject(ConvertibleRoof[vehicleid]);
  335.       VehicleInfo[vehicleid][Convertible] = 0;
  336.         }
  337.         case 567:
  338.         {
  339.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  340.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.70, 2.0, 0, 0, 0);
  341.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.70, 0.0, 0.0, 0.0);
  342.       SetTimer("CloseBootRoof", 5, 0);
  343.       DestroyObject(ConvertibleRoof[vehicleid]);
  344.       VehicleInfo[vehicleid][Convertible] = 0;
  345.         }
  346.   }
  347.   return 1;
  348. }
  349. public MoveConvertibleRoofUp(playerid)
  350. {
  351.   new Float:Pos[3];
  352.   new vehicleid = GetPlayerVehicleID(playerid);
  353.   new modelid = GetVehicleModel(vehicleid);
  354.   switch(modelid)
  355.   {
  356.         case 536:
  357.         {
  358.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  359.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.70, 2.0, 0, 0, 0);
  360.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.70, 0.0, 0.0, 0.0);
  361.       SetTimer("MoveConvertibleRoofUp1",100, 0);
  362.         }
  363.         case 567:
  364.         {
  365.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  366.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.70, 2.0, 0, 0, 0);
  367.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.70, 0.0, 0.0, 0.0);
  368.       SetTimer("MoveConvertibleRoofUp1",100, 0);
  369.     }
  370.   }
  371.   return 1;
  372. }
  373. public MoveConvertibleRoofUp1(playerid)
  374. {
  375.   new Float:Pos[3];
  376.   new vehicleid = GetPlayerVehicleID(playerid);
  377.   new modelid = GetVehicleModel(vehicleid);
  378.   switch(modelid)
  379.   {
  380.         case 536:
  381.         {
  382.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  383.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.60, 2.0, 0, 0, 0);
  384.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.60, 0.0, 0.0, 0.0);
  385.       SetTimer("MoveConvertibleRoofUp2",100, 0);
  386.         }
  387.         case 567:
  388.         {
  389.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  390.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.60, 2.0, 0, 0, 0);
  391.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.60, 0.0, 0.0, 0.0);
  392.       SetTimer("MoveConvertibleRoofUp2",100, 0);
  393.     }
  394.   }
  395.   return 1;
  396. }
  397. public MoveConvertibleRoofUp2(playerid)
  398. {
  399.   new Float:Pos[3];
  400.   new vehicleid = GetPlayerVehicleID(playerid);
  401.   new modelid = GetVehicleModel(vehicleid);
  402.   switch(modelid)
  403.   {
  404.         case 536:
  405.         {
  406.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  407.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.50, 2.0, 0, 0, 0);
  408.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.50, 0.0, 0.0, 0.0);
  409.       SetTimer("MoveConvertibleRoofUp3",100, 0);
  410.         }
  411.         case 567:
  412.         {
  413.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  414.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.50, 2.0, 0, 0, 0);
  415.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.50, 0.0, 0.0, 0.0);
  416.       SetTimer("MoveConvertibleRoofUp3",100, 0);
  417.     }
  418.   }
  419.   return 1;
  420. }
  421. public MoveConvertibleRoofUp3(playerid)
  422. {
  423.   new Float:Pos[3];
  424.   new vehicleid = GetPlayerVehicleID(playerid);
  425.   new modelid = GetVehicleModel(vehicleid);
  426.   switch(modelid)
  427.   {
  428.         case 536:
  429.         {
  430.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  431.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.35, 2.0, 0, 0, 0);
  432.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.35, 0.0, 0.0, 0.0);
  433.       SetTimer("MoveConvertibleRoofUp4",100, 0);
  434.         }
  435.         case 567:
  436.         {
  437.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  438.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.40, 2.0, 0, 0, 0);
  439.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.40, 0.0, 0.0, 0.0);
  440.       SetTimer("MoveConvertibleRoofUp4",100, 0);
  441.     }
  442.   }
  443.   return 1;
  444. }
  445. public MoveConvertibleRoofUp4(playerid)
  446. {
  447.   new Float:Pos[3];
  448.   new vehicleid = GetPlayerVehicleID(playerid);
  449.   new modelid = GetVehicleModel(vehicleid);
  450.   switch(modelid)
  451.   {
  452.         case 536:
  453.         {
  454.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  455.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.20, 2.0, 0, 0, 0);
  456.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.20, 0.0, 0.0, 0.0);
  457.       SetTimer("MoveConvertibleRoofUp5",100, 0);
  458.         }
  459.         case 567:
  460.         {
  461.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  462.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.30, 2.0, 0, 0, 0);
  463.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.30, 0.0, 0.0, 0.0);
  464.       SetTimer("MoveConvertibleRoofUp5",100, 0);
  465.     }
  466.   }
  467.   return 1;
  468. }
  469. public MoveConvertibleRoofUp5(playerid)
  470. {
  471.   new Float:Pos[3];
  472.   new vehicleid = GetPlayerVehicleID(playerid);
  473.   new modelid = GetVehicleModel(vehicleid);
  474.   switch(modelid)
  475.   {
  476.         case 536:
  477.         {
  478.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  479.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.10, 2.0, 0, 0, 0);
  480.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.10, 0.0, 0.0, 0.0);
  481.       SetTimer("MoveConvertibleRoofUp6",100, 0);
  482.         }
  483.         case 567:
  484.         {
  485.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  486.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-1.0, Pos[2]-0.26, 2.0, 0, 0, 0);
  487.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-1.0, Pos[2]-0.26, 0.0, 0.0, 0.0);
  488.       SetTimer("MoveConvertibleRoofUp6",100, 0);
  489.     }
  490.   }
  491.   return 1;
  492. }
  493. public MoveConvertibleRoofUp6(playerid)
  494. {
  495.   new Float:Pos[3];
  496.   new vehicleid = GetPlayerVehicleID(playerid);
  497.   new modelid = GetVehicleModel(vehicleid);
  498.   switch(modelid)
  499.   {
  500.         case 536:
  501.         {
  502.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  503.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.8, Pos[2], 2.0, 0, 0, 0);
  504.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.8, Pos[2], 0.0, 0.0, 0.0);
  505.           SetTimer("MoveConvertibleRoofUp7",100, 0);
  506.         }
  507.         case 567:
  508.         {
  509.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  510.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.8, Pos[2]-0.25, 2.0, 0, 0, 0);
  511.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.25, 0.0, 0.0, 0.0);
  512.           SetTimer("MoveConvertibleRoofUp7",100, 0);
  513.     }
  514.   }
  515.   return 1;
  516. }
  517. public MoveConvertibleRoofUp7(playerid)
  518. {
  519.   new Float:Pos[3];
  520.   new vehicleid = GetPlayerVehicleID(playerid);
  521.   new modelid = GetVehicleModel(vehicleid);
  522.   switch(modelid)
  523.   {
  524.         case 536:
  525.         {
  526.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  527.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.7, Pos[2], 2.0, 0, 0, 0);
  528.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.7, Pos[2], 0.0, 0.0, 0.0);
  529.       SetTimer("MoveConvertibleRoofUp8", 100, 0);
  530.         }
  531.         case 567:
  532.         {
  533.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  534.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.7, Pos[2]-0.25, 2.0, 0, 0, 0);
  535.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.7, Pos[2]-0.25, 0.0, 0.0, 0.0);
  536.       SetTimer("MoveConvertibleRoofUp8", 100, 0);
  537.     }
  538.   }
  539.   return 1;
  540. }
  541. public MoveConvertibleRoofUp8(playerid)
  542. {
  543.   new Float:Pos[3];
  544.   new vehicleid = GetPlayerVehicleID(playerid);
  545.   new modelid = GetVehicleModel(vehicleid);
  546.   switch(modelid)
  547.   {
  548.         case 536:
  549.         {
  550.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  551.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.5, Pos[2], 2.0, 0, 0, 0);
  552.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.5, Pos[2], 0.0, 0.0, 0.0);
  553.       SetTimer("MoveConvertibleRoofUp9", 100, 0);
  554.         }
  555.         case 567:
  556.         {
  557.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  558.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.5, Pos[2]-0.25, 2.0, 0, 0, 0);
  559.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.5, Pos[2]-0.25, 0.0, 0.0, 0.0);
  560.       SetTimer("MoveConvertibleRoofUp9", 100, 0);
  561.     }
  562.   }
  563.   return 1;
  564. }
  565. public MoveConvertibleRoofUp9(playerid)
  566. {
  567.   new Float:Pos[3];
  568.   new vehicleid = GetPlayerVehicleID(playerid);
  569.   new modelid = GetVehicleModel(vehicleid);
  570.   switch(modelid)
  571.   {
  572.         case 536:
  573.         {
  574.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  575.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.4, Pos[2], 2.0, 0, 0, 0);
  576.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.4, Pos[2], 0.0, 0.0, 0.0);
  577.       SetTimer("MoveConvertibleRoofUp10", 100, 0);
  578.         }
  579.         case 567:
  580.         {
  581.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  582.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.3, Pos[2]-0.24, 2.0, 0, 0, 0);
  583.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  584.       SetTimer("MoveConvertibleRoofUp10", 100, 0);
  585.     }
  586.   }
  587.   return 1;
  588. }
  589. public MoveConvertibleRoofUp10(playerid)
  590. {
  591.   new Float:Pos[3];
  592.   new vehicleid = GetPlayerVehicleID(playerid);
  593.   new modelid = GetVehicleModel(vehicleid);
  594.   switch(modelid)
  595.   {
  596.         case 536:
  597.         {
  598.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  599.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.2, Pos[2], 2.0, 0, 0, 0);
  600.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.2, Pos[2], 0.0, 0.0, 0.0);
  601.       SetTimer("MoveConvertibleRoofUp11", 100, 0);
  602.         }
  603.         case 567:
  604.         {
  605.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  606.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.1, Pos[2]-0.25, 2.0, 0, 0, 0);
  607.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.1, Pos[2]-0.25, 0.0, 0.0, 0.0);
  608.       SetTimer("MoveConvertibleRoofUp11", 100, 0);
  609.     }
  610.   }
  611.   return 1;
  612. }
  613. public MoveConvertibleRoofUp11(playerid)
  614. {
  615.   new Float:Pos[3];
  616.   new vehicleid = GetPlayerVehicleID(playerid);
  617.   new modelid = GetVehicleModel(vehicleid);
  618.   switch(modelid)
  619.   {
  620.         case 536:
  621.         {
  622.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  623.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]-0.1, Pos[2], 2.0, 0, 0, 0);
  624.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]-0.1, Pos[2], 0.0, 0.0, 0.0);
  625.       SetTimer("MoveConvertibleRoofUp12", 100, 0);
  626.         }
  627.         case 567:
  628.         {
  629.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  630.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]+0.2, Pos[2]-0.25, 2.0, 0, 0, 0);
  631.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]+0.2, Pos[2]-0.25, 0.0, 0.0, 0.0);
  632.       SetTimer("MoveConvertibleRoofUp12", 100, 0);
  633.         }
  634.   }
  635.   return 1;
  636. }
  637. public MoveConvertibleRoofUp12(playerid)
  638. {
  639.   new Float:Pos[3];
  640.   new vehicleid = GetPlayerVehicleID(playerid);
  641.   new modelid = GetVehicleModel(vehicleid);
  642.   switch(modelid)
  643.   {
  644.         case 536:
  645.         {
  646.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  647.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1], Pos[2], 2.0, 0, 0, 0);
  648.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1], Pos[2], 0.0, 0.0, 0.0);
  649.       SetTimer("CloseBootRoof", 5, 0);
  650.       VehicleInfo[vehicleid][Convertible] = 1;
  651.         }
  652.         case 567:
  653.         {
  654.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  655.       MoveObject(ConvertibleRoof[vehicleid], Pos[0], Pos[1]+0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  656.       AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, Pos[0], Pos[1]+0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  657.       SetTimer("CloseBootRoof", 5, 0);
  658.       VehicleInfo[vehicleid][Convertible] = 1;
  659.         }
  660.   }
  661.   return 1;
  662. }
  663. public OnGameModeInit()
  664. {
  665.    AddStaticVehicle(536,2039.6925,1348.0242,10.2964,314.1935,3,0);
  666.    AddStaticVehicle(431, 2039.3744,1352.7509,15.2967,313.6479,6,6);
  667. }
  668. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  669. {
  670.   new State = GetPlayerState(playerid);
  671.   if(State == PLAYER_STATE_DRIVER)
  672.   {
  673.     if(PRESSED(KEY_ACTION))
  674.         {
  675.       new Float:X, Float:Y, Float:Z;
  676.           switch(modelid)
  677.           {
  678.                 case 536:
  679.                 {
  680.                   if(VehicleInfo[vehicleid][Convertible] == 0)
  681.                   {
  682.                         ConvertibleRoof[vehicleid] = CreateObject(1128, X, Y, Z, 0, 0, 0);
  683.                         AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, X, Y-1.0, Z-0.75, 0.0, 0.0, 0.0);
  684.                         new engine, lights, alarm, doors, bonnet, boot, objective;
  685.             GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  686.             SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  687.             GameTextForPlayer(playerid,"~w~Roof: ~g~Ascending", 600, 3);
  688.             SetTimer("MoveConvertibleRoofUp", 100, 0);
  689.                 VehicleInfo[vehicleid][Convertible] = 3;
  690.                   }
  691.                   else if(VehicleInfo[vehicleid][Convertible] == 1)
  692.                   {
  693.             new engine, lights, alarm, doors, bonnet, boot, objective;
  694.             GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  695.             SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  696.             GameTextForPlayer(playerid,"~w~Roof: ~r~Decending", 600, 3);
  697.             SetTimer("MoveConvertibleRoofDown", 100, 0);
  698.             VehicleInfo[vehicleid][Convertible] = 3;
  699.                   }
  700.                   else if(VehicleInfo[vehicleid][Convertible] == 3)
  701.                   {
  702.                  
  703.                   }
  704.                 }
  705.                 case 567:
  706.                 {
  707.               if(VehicleInfo[vehicleid][Convertible] == 0)
  708.               {
  709.               ConvertibleRoof[vehicleid] = CreateObject(1131, X, Y-1.0, Z-0.75, 0, 0, 0);
  710.               AttachObjectToVehicle(ConvertibleRoof[vehicleid], vehicleid, X, Y-1.0, Z-0.75, 0.0, 0.0, 0.0);
  711.                           new engine, lights, alarm, doors, bonnet, boot, objective;
  712.               GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  713.               SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  714.               GameTextForPlayer(playerid,"~w~Roof: ~g~Ascending", 600, 3);
  715.               SetTimer("MoveConvertibleRoofUp", 100, 0);
  716.                           VehicleInfo[vehicleid][Convertible] = 3;
  717.               }
  718.               else if(VehicleInfo[vehicleid][Convertible] == 1)
  719.               {
  720.              new engine, lights, alarm, doors, bonnet, boot, objective;
  721.              GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  722.              SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  723.              GameTextForPlayer(playerid,"~w~Roof: ~r~Decending", 600, 3);
  724.              SetTimer("MoveConvertibleRoofDown", 100, 0);
  725.              VehicleInfo[vehicleid][Convertible] = 3;
  726.               }
  727.               else if(VehicleInfo[vehicleid][Convertible] == 3)
  728.               {
  729.              
  730.               }
  731.             }
  732.           }
  733.         }
  734. return 1;
  735. }
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