SHARE
TWEET

Convertiable Samp

a guest Aug 21st, 2014 287 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///-----credit to pillhead2007 for this script :)
  2. #include <a_samp>
  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. forward CloseBootRoof(playerid);
  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. public CloseBootRoof(playerid)
  23. {
  24.   new vehicleid = GetPlayerVehicleID(playerid);
  25.   new engine, lights, alarm, doors, bonnet, boot, objective;
  26.   GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  27.   SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 0, objective);
  28.   return 1;
  29. }
  30. public MoveConvertibleRoofDown(playerid)
  31. {
  32.   new Float:Pos[3];
  33.   new vehicleid = GetPlayerVehicleID(playerid);
  34.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  35.   new modelid = GetVehicleModel(vehicleid);
  36.   switch(modelid)
  37.   {
  38.         case 567:
  39.         {
  40.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]+0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  41.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]+0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  42.       SetTimer("MoveConvertibleRoofDown1", 100, 0);
  43.     }
  44.   }
  45.   return 1;
  46. }
  47. public MoveConvertibleRoofDown1(playerid)
  48. {
  49.   new Float:Pos[3];
  50.   new vehicleid = GetPlayerVehicleID(playerid);
  51.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  52.   new modelid = GetVehicleModel(vehicleid);
  53.   switch(modelid)
  54.   {
  55.         case 567:
  56.         {
  57.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]+0.2, Pos[2]-0.25, 2.0, 0, 0, 0);
  58.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]+0.2, Pos[2]-0.25, 0.0, 0.0, 0.0);
  59.       SetTimer("MoveConvertibleRoofDown2", 100, 0);
  60.     }
  61.   }
  62.   return 1;
  63. }
  64. public MoveConvertibleRoofDown2(playerid)
  65. {
  66.   new Float:Pos[3];
  67.   new vehicleid = GetPlayerVehicleID(playerid);
  68.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  69.   new modelid = GetVehicleModel(vehicleid);
  70.   switch(modelid)
  71.   {
  72.         case 567:
  73.         {
  74.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.1, Pos[2]-0.25, 2.0, 0, 0, 0);
  75.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.1, Pos[2]-0.25, 0.0, 0.0, 0.0);
  76.       SetTimer("MoveConvertibleRoofDown3", 100, 0);
  77.     }
  78.   }
  79.   return 1;
  80. }
  81. public MoveConvertibleRoofDown3(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 567:
  90.         {
  91.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  92.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  93.       SetTimer("MoveConvertibleRoofDown4", 100, 0);
  94.     }
  95.   }
  96.   return 1;
  97. }
  98. public MoveConvertibleRoofDown4(playerid)
  99. {
  100.   new Float:Pos[3];
  101.   new vehicleid = GetPlayerVehicleID(playerid);
  102.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  103.   new modelid = GetVehicleModel(vehicleid);
  104.   switch(modelid)
  105.   {
  106.         case 567:
  107.         {
  108.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.5, Pos[2]-0.25, 2.0, 0, 0, 0);
  109.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.5, Pos[2]-0.25, 0.0, 0.0, 0.0);
  110.       SetTimer("MoveConvertibleRoofDown5", 100, 0);
  111.     }
  112.   }
  113.   return 1;
  114. }
  115. public MoveConvertibleRoofDown5(playerid)
  116. {
  117.   new Float:Pos[3];
  118.   new vehicleid = GetPlayerVehicleID(playerid);
  119.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  120.   new modelid = GetVehicleModel(vehicleid);
  121.   switch(modelid)
  122.   {
  123.         case 567:
  124.         {
  125.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.7, Pos[2]-0.25, 2.0, 0, 0, 0);
  126.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.7, Pos[2]-0.25, 0.0, 0.0, 0.0);
  127.       SetTimer("MoveConvertibleRoofDown6", 100, 0);
  128.     }
  129.   }
  130.   return 1;
  131. }
  132. public MoveConvertibleRoofDown6(playerid)
  133. {
  134.   new Float:Pos[3];
  135.   new vehicleid = GetPlayerVehicleID(playerid);
  136.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  137.   new modelid = GetVehicleModel(vehicleid);
  138.   switch(modelid)
  139.   {
  140.         case 567:
  141.         {
  142.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.25, 2.0, 0, 0, 0);
  143.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.25, 0.0, 0.0, 0.0);
  144.       SetTimer("MoveConvertibleRoofDown7", 100, 0);
  145.     }
  146.   }
  147.   return 1;
  148. }
  149. public MoveConvertibleRoofDown7(playerid)
  150. {
  151.   new Float:Pos[3];
  152.   new vehicleid = GetPlayerVehicleID(playerid);
  153.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  154.   new modelid = GetVehicleModel(vehicleid);
  155.   switch(modelid)
  156.   {
  157.         case 567:
  158.         {
  159.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.26, 2.0, 0, 0, 0);
  160.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.26, 0.0, 0.0, 0.0);
  161.       SetTimer("MoveConvertibleRoofDown8", 100, 0);
  162.     }
  163.   }
  164.   return 1;
  165. }
  166. public MoveConvertibleRoofDown8(playerid)
  167. {
  168.   new Float:Pos[3];
  169.   new vehicleid = GetPlayerVehicleID(playerid);
  170.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  171.   new modelid = GetVehicleModel(vehicleid);
  172.   switch(modelid)
  173.   {
  174.         case 567:
  175.         {
  176.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.30, 2.0, 0, 0, 0);
  177.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.30, 0.0, 0.0, 0.0);
  178.       SetTimer("MoveConvertibleRoofDown9", 100, 0);
  179.     }
  180.   }
  181.   return 1;
  182. }
  183. public MoveConvertibleRoofDown9(playerid)
  184. {
  185.   new Float:Pos[3];
  186.   new vehicleid = GetPlayerVehicleID(playerid);
  187.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  188.   new modelid = GetVehicleModel(vehicleid);
  189.   switch(modelid)
  190.   {
  191.         case 567:
  192.         {
  193.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.40, 2.0, 0, 0, 0);
  194.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.40, 0.0, 0.0, 0.0);
  195.       SetTimer("MoveConvertibleRoofDown10", 100, 0);
  196.         }
  197.   }
  198.   return 1;
  199. }
  200. public MoveConvertibleRoofDown10(playerid)
  201. {
  202.   new Float:Pos[3];
  203.   new vehicleid = GetPlayerVehicleID(playerid);
  204.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  205.   new modelid = GetVehicleModel(vehicleid);
  206.   switch(modelid)
  207.   {
  208.         case 567:
  209.         {
  210.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.50, 2.0, 0, 0, 0);
  211.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.50, 0.0, 0.0, 0.0);
  212.       SetTimer("MoveConvertibleRoofDown11", 100, 0);
  213.         }
  214.   }
  215.   return 1;
  216. }
  217. public MoveConvertibleRoofDown11(playerid)
  218. {
  219.   new Float:Pos[3];
  220.   new vehicleid = GetPlayerVehicleID(playerid);
  221.   GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  222.   new modelid = GetVehicleModel(vehicleid);
  223.   switch(modelid)
  224.   {
  225.         case 567:
  226.         {
  227.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  228.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.60, 2.0, 0, 0, 0);
  229.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.60, 0.0, 0.0, 0.0);
  230.       SetTimer("MoveConvertibleRoofDown12", 100, 0);
  231.         }
  232.   }
  233.   return 1;
  234. }
  235. public MoveConvertibleRoofDown12(playerid)
  236. {
  237.   new Float:Pos[3];
  238.   new vehicleid = GetPlayerVehicleID(playerid);
  239.   new modelid = GetVehicleModel(vehicleid);
  240.   switch(modelid)
  241.   {
  242.         case 567:
  243.         {
  244.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  245.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.70, 2.0, 0, 0, 0);
  246.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.70, 0.0, 0.0, 0.0);
  247.       SetTimer("CloseBootRoof", 5, 0);
  248.       DestroyObject(ConvertibleRoof[0]);
  249.       VehicleInfo[vehicleid][Convertible] = 0;
  250.         }
  251.   }
  252.   return 1;
  253. }
  254. public MoveConvertibleRoofUp(playerid)
  255. {
  256.   new Float:Pos[3];
  257.   new vehicleid = GetPlayerVehicleID(playerid);
  258.   new modelid = GetVehicleModel(vehicleid);
  259.   switch(modelid)
  260.   {
  261.         case 567:
  262.         {
  263.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  264.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.70, 2.0, 0, 0, 0);
  265.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.70, 0.0, 0.0, 0.0);
  266.       SetTimer("MoveConvertibleRoofUp1",100, 0);
  267.     }
  268.   }
  269.   return 1;
  270. }
  271. public MoveConvertibleRoofUp1(playerid)
  272. {
  273.   new Float:Pos[3];
  274.   new vehicleid = GetPlayerVehicleID(playerid);
  275.   new modelid = GetVehicleModel(vehicleid);
  276.   switch(modelid)
  277.   {
  278.         case 567:
  279.         {
  280.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  281.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.60, 2.0, 0, 0, 0);
  282.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.60, 0.0, 0.0, 0.0);
  283.       SetTimer("MoveConvertibleRoofUp2",100, 0);
  284.     }
  285.   }
  286.   return 1;
  287. }
  288. public MoveConvertibleRoofUp2(playerid)
  289. {
  290.   new Float:Pos[3];
  291.   new vehicleid = GetPlayerVehicleID(playerid);
  292.   new modelid = GetVehicleModel(vehicleid);
  293.   switch(modelid)
  294.   {
  295.         case 567:
  296.         {
  297.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  298.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.50, 2.0, 0, 0, 0);
  299.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.50, 0.0, 0.0, 0.0);
  300.       SetTimer("MoveConvertibleRoofUp3",100, 0);
  301.     }
  302.   }
  303.   return 1;
  304. }
  305. public MoveConvertibleRoofUp3(playerid)
  306. {
  307.   new Float:Pos[3];
  308.   new vehicleid = GetPlayerVehicleID(playerid);
  309.   new modelid = GetVehicleModel(vehicleid);
  310.   switch(modelid)
  311.   {
  312.         case 567:
  313.         {
  314.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  315.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.40, 2.0, 0, 0, 0);
  316.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.40, 0.0, 0.0, 0.0);
  317.       SetTimer("MoveConvertibleRoofUp4",100, 0);
  318.     }
  319.   }
  320.   return 1;
  321. }
  322. public MoveConvertibleRoofUp4(playerid)
  323. {
  324.   new Float:Pos[3];
  325.   new vehicleid = GetPlayerVehicleID(playerid);
  326.   new modelid = GetVehicleModel(vehicleid);
  327.   switch(modelid)
  328.   {
  329.         case 567:
  330.         {
  331.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  332.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.30, 2.0, 0, 0, 0);
  333.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.30, 0.0, 0.0, 0.0);
  334.       SetTimer("MoveConvertibleRoofUp5",100, 0);
  335.     }
  336.   }
  337.   return 1;
  338. }
  339. public MoveConvertibleRoofUp5(playerid)
  340. {
  341.   new Float:Pos[3];
  342.   new vehicleid = GetPlayerVehicleID(playerid);
  343.   new modelid = GetVehicleModel(vehicleid);
  344.   switch(modelid)
  345.   {
  346.         case 567:
  347.         {
  348.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  349.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.26, 2.0, 0, 0, 0);
  350.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.26, 0.0, 0.0, 0.0);
  351.       SetTimer("MoveConvertibleRoofUp6",100, 0);
  352.     }
  353.   }
  354.   return 1;
  355. }
  356. public MoveConvertibleRoofUp6(playerid)
  357. {
  358.   new Float:Pos[3];
  359.   new vehicleid = GetPlayerVehicleID(playerid);
  360.   new modelid = GetVehicleModel(vehicleid);
  361.   switch(modelid)
  362.   {
  363.         case 567:
  364.         {
  365.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  366.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.8, Pos[2]-0.25, 2.0, 0, 0, 0);
  367.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.8, Pos[2]-0.25, 0.0, 0.0, 0.0);
  368.           SetTimer("MoveConvertibleRoofUp7",100, 0);
  369.     }
  370.   }
  371.   return 1;
  372. }
  373. public MoveConvertibleRoofUp7(playerid)
  374. {
  375.   new Float:Pos[3];
  376.   new vehicleid = GetPlayerVehicleID(playerid);
  377.   new modelid = GetVehicleModel(vehicleid);
  378.   switch(modelid)
  379.   {
  380.         case 567:
  381.         {
  382.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  383.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.7, Pos[2]-0.25, 2.0, 0, 0, 0);
  384.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.7, Pos[2]-0.25, 0.0, 0.0, 0.0);
  385.       SetTimer("MoveConvertibleRoofUp8", 100, 0);
  386.     }
  387.   }
  388.   return 1;
  389. }
  390. public MoveConvertibleRoofUp8(playerid)
  391. {
  392.   new Float:Pos[3];
  393.   new vehicleid = GetPlayerVehicleID(playerid);
  394.   new modelid = GetVehicleModel(vehicleid);
  395.   switch(modelid)
  396.   {
  397.         case 567:
  398.         {
  399.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  400.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.5, Pos[2]-0.25, 2.0, 0, 0, 0);
  401.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.5, Pos[2]-0.25, 0.0, 0.0, 0.0);
  402.       SetTimer("MoveConvertibleRoofUp9", 100, 0);
  403.     }
  404.   }
  405.   return 1;
  406. }
  407. public MoveConvertibleRoofUp9(playerid)
  408. {
  409.   new Float:Pos[3];
  410.   new vehicleid = GetPlayerVehicleID(playerid);
  411.   new modelid = GetVehicleModel(vehicleid);
  412.   switch(modelid)
  413.   {
  414.         case 567:
  415.         {
  416.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  417.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.3, Pos[2]-0.24, 2.0, 0, 0, 0);
  418.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  419.       SetTimer("MoveConvertibleRoofUp10", 100, 0);
  420.     }
  421.   }
  422.   return 1;
  423. }
  424. public MoveConvertibleRoofUp10(playerid)
  425. {
  426.   new Float:Pos[3];
  427.   new vehicleid = GetPlayerVehicleID(playerid);
  428.   new modelid = GetVehicleModel(vehicleid);
  429.   switch(modelid)
  430.   {
  431.         case 567:
  432.         {
  433.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  434.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]-0.1, Pos[2]-0.25, 2.0, 0, 0, 0);
  435.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]-0.1, Pos[2]-0.25, 0.0, 0.0, 0.0);
  436.       SetTimer("MoveConvertibleRoofUp11", 100, 0);
  437.     }
  438.   }
  439.   return 1;
  440. }
  441. public MoveConvertibleRoofUp11(playerid)
  442. {
  443.   new Float:Pos[3];
  444.   new vehicleid = GetPlayerVehicleID(playerid);
  445.   new modelid = GetVehicleModel(vehicleid);
  446.   switch(modelid)
  447.   {
  448.         case 567:
  449.         {
  450.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  451.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]+0.2, Pos[2]-0.25, 2.0, 0, 0, 0);
  452.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]+0.2, Pos[2]-0.25, 0.0, 0.0, 0.0);
  453.       SetTimer("MoveConvertibleRoofUp12", 100, 0);
  454.         }
  455.   }
  456.   return 1;
  457. }
  458. public MoveConvertibleRoofUp12(playerid)
  459. {
  460.   new Float:Pos[3];
  461.   new vehicleid = GetPlayerVehicleID(playerid);
  462.   new modelid = GetVehicleModel(vehicleid);
  463.   switch(modelid)
  464.   {
  465.         case 567:
  466.         {
  467.       GetVehicleModelInfo(vehicleid, VEHICLE_MODEL_INFO_SIZE, Pos[0], Pos[1], Pos[2]);
  468.       MoveObject(ConvertibleRoof[0], Pos[0], Pos[1]+0.3, Pos[2]-0.25, 2.0, 0, 0, 0);
  469.       AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, Pos[0], Pos[1]+0.3, Pos[2]-0.25, 0.0, 0.0, 0.0);
  470.       SetTimer("CloseBootRoof", 5, 0);
  471.       VehicleInfo[vehicleid][Convertible] = 1;
  472.         }
  473.   }
  474.   return 1;
  475. }
  476. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  477. {
  478.   new State = GetPlayerState(playerid);
  479.   if(State == PLAYER_STATE_DRIVER)
  480.   {
  481.         if(PRESSED(KEY_ACTION))
  482.         {
  483.       new Float:X, Float:Y, Float:Z;
  484.           switch(modelid)
  485.           {
  486.                 case 567:
  487.                 {
  488.               if(VehicleInfo[vehicleid][Convertible] == 0)
  489.               {
  490.               ConvertibleRoof[0] = CreateObject(1131, X, Y-0.8, Z-0.75, 0, 0, 0);
  491.               AttachObjectToVehicle(ConvertibleRoof[0], vehicleid, X, Y-0.8, Z-0.75, 0.0, 0.0, 0.0);
  492.                           new engine, lights, alarm, doors, bonnet, boot, objective;
  493.               GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  494.               SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  495.               GameTextForPlayer(playerid,"~w~Roof: ~g~Ascending", 600, 3);
  496.               SetTimer("MoveConvertibleRoofUp", 100, 0);
  497.                           VehicleInfo[vehicleid][Convertible] = 3;
  498.               }
  499.               else if(VehicleInfo[vehicleid][Convertible] == 1)
  500.               {
  501.              new engine, lights, alarm, doors, bonnet, boot, objective;
  502.              GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  503.              SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  504.              GameTextForPlayer(playerid,"~w~Roof: ~r~Decending", 600, 3);
  505.              SetTimer("MoveConvertibleRoofDown", 100, 0);
  506.              VehicleInfo[vehicleid][Convertible] = 3;
  507.               }
  508.               else if(VehicleInfo[vehicleid][Convertible] == 3)
  509.               {
  510.              
  511.               }
  512.             }
  513.           }
  514.         }
  515.         return 1;
  516. }
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