Advertisement
sseebbyy

Tuning System for VC:MP ! :o

Mar 14th, 2015
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 26.61 KB | None | 0 0
  1. /*
  2.  
  3. Tuning System by Seby for Vice City Multiplayer. (0.4)
  4. ===================================================================================================================================================================
  5.  
  6. CREDITS:
  7.  
  8. Scripter: Seby (aka sseebbyy)
  9. Special credits goes to Stormeus for hydraulics !
  10.  
  11. DO NOT REMOVE THEM, OR WE WILL NEVER OFFER YOU HELP OR SCRIPTS AGAIN !
  12.  
  13. ===================================================================================================================================================================
  14.  
  15. Description:
  16.     This system let you customize and personalize your ride, making it better looking. 8)
  17.     It sends the car in an unique garage, and shows the menu.
  18.    
  19.     (without the Custom Menu System, you cannot make this script work)
  20. */
  21.  
  22. tuneMenuID <- 0;
  23. tuneSecondMenuID <- tuneMenuID + 1;
  24.  
  25. TUNE_CAMERA_LOOK <- Vector( -1045.39, -477.155, 10.9386 );
  26. TUNE_CAMERA_TOP <- Vector( -1041.19, -470.739, 13.145 );
  27. TUNE_CAMERA_TOP_FRONT <- Vector( -1038.92, -476.014, 13.7027 );
  28. TUNE_CAMERA_TOP_REAR <- Vector( -1053.45, -478.343, 13.859 );
  29. TUNE_CAMERA_FRONT <- Vector( -1038.7, -476.018, 10.9283 );
  30. TUNE_CAMERA_REAR <- Vector( -1053.2, -478.082, 10.9283 );
  31. TUNE_CAMERA_SIDE <- Vector( -1047.44, -482.952, 10.9876 );
  32.  
  33. TUNE_WORLD <- 1000;
  34. tuneColorPrefix <- "[#FFC23D]";
  35. tuneColorText <- "[#E6E6E6]";
  36. tuneColorError <- "[#FF0000]";
  37. tuneColorEnabled <- "[#9CFF5E]";
  38. tuneColorDisabled <- "[#5E64FF]";
  39.  
  40. TUNE_LIMIT_ACCELERATION <- 55;
  41. TUNE_LIMIT_MAXSPEED <- 300;
  42. TUNE_LIMIT_TRACTION <- 1;
  43.  
  44. tuneHydraulicsVariant <- array( GetMaxPlayers(), null );
  45. tuneHydraulicsEnabled <- array( 1000, 0 );
  46.  
  47. tuneSavedPos <- array( GetMaxPlayers(), null );
  48. tuneSavedAngle <- array( GetMaxPlayers(), null );
  49.  
  50. //==================== KEYS ==============================
  51. // NUMPADs
  52. TUNE_HYDRAULICS_LEFT  <- BindKey( true, 0x64, 0, 0 );
  53. TUNE_HYDRAULICS_RIGHT <- BindKey( true, 0x66, 0, 0 );
  54. TUNE_HYDRAULICS_UP    <- BindKey( true, 0x68, 0, 0 );
  55. TUNE_HYDRAULICS_DOWN  <- BindKey( true, 0x62, 0, 0 );
  56.  
  57. // for keyboards without NUMPADs
  58. // U (up), J (down), H (left), K (right)
  59. TUNE_HYDRAULICS_LEFT2  <- BindKey( true, 0x48, 0, 0 );
  60. TUNE_HYDRAULICS_RIGHT2 <- BindKey( true, 0x4B, 0, 0 );
  61. TUNE_HYDRAULICS_UP2    <- BindKey( true, 0x55, 0, 0 );
  62. TUNE_HYDRAULICS_DOWN2  <- BindKey( true, 0x4A, 0, 0 );
  63. //========================================================
  64.    
  65. print( "Tuning System by Seby was successfully loaded !" );
  66.    
  67. function tuneCreateMenu( )
  68. {
  69.     CreateMenu( "Tuning System", "Colour 1", "Colour 2", "Front & Rear Bumpers", "Performance", "Suspension", "Custom Lights", "Trunk & Hood", "Hydraulics", "Firetruk's Handling", "Deluxo's Handling" );
  70.         menu[ tuneMenuID ].AddSubmenu( 1, "/Colour 1", "Black", "White", "Grey", "Red", "Green", "Blue", "Yellow", "Pink", "Next Colour", "Previous Colour" );
  71.         menu[ tuneMenuID ].AddSubmenu( 2, "/Colour 2", "Black", "White", "Grey", "Red", "Green", "Blue", "Yellow", "Pink", "Next Colour", "Previous Colour" );
  72.         menu[ tuneMenuID ].AddSubmenu( 3, "/Front & Rear Bumpers", "Front Bumper", "Rear Bumper" );
  73.         menu[ tuneMenuID ].AddSubmenu( 4, "/Performance", "Increase Acceleration", "Increase MaxSpeed", "Upgrade Traction", "Upgrade Brakes", "Drive on Water" );
  74.         menu[ tuneMenuID ].AddSubmenu( 5, "/Suspension", "Increase Height", "Decrease Height", "High", "Medium", "Low", "Lowest", "Bias - Increase", "Bias - Decrease" );
  75.         menu[ tuneMenuID ].AddSubmenu( 6, "/Custom Lights", "Both - Remove Boxes", "Both - Next type", "Both - Previous type", "Front - Green", "Front - Orange", "Rear - Green", "Rear - Red", "Rear - Orange", "Front - Default", "Rear - Default" );
  76.         menu[ tuneMenuID ].AddSubmenu( 7, "/Trunk & Hood", "Trunk", "Hood" );  
  77. }
  78.  
  79. function tuneCreateSecondMenu( )
  80. {
  81.     CreateMenu( "Tuning System", "Colour 1", "Colour 2", "Custom Lights", "Performance" );
  82.         menu[ tuneSecondMenuID ].AddSubmenu( 1, "/Colour 1", "Black", "White", "Grey", "Red", "Green", "Blue", "Yellow", "Pink", "Next Colour", "Previous Colour" );
  83.         menu[ tuneSecondMenuID ].AddSubmenu( 2, "/Colour 2", "Black", "White", "Grey", "Red", "Green", "Blue", "Yellow", "Pink", "Next Colour", "Previous Colour" );
  84.         menu[ tuneSecondMenuID ].AddSubmenu( 3, "/Custom Lights", "Both - Remove Boxes", "Both - Next type", "Both - Previous type", "Front - Green", "Front - Orange", "Rear - Green", "Rear - Red", "Rear - Orange", "Front - Default", "Rear - Default" );
  85.         menu[ tuneSecondMenuID ].AddSubmenu( 4, "/Performance", "Increase Acceleration", "Increase MaxSpeed", "Upgrade Traction", "Upgrade Brakes", "Drive on Water" );
  86. }
  87.    
  88. function tuneJoin( player )
  89. {
  90.     tuneSavedPos[ player.ID ] = 0;
  91.     tuneSavedAngle[ player.ID ] = 0;
  92.     tuneHydraulicsVariant[ player.ID ] = 0;
  93. }  
  94.  
  95. function tuneKeyDown( player, key )
  96. {
  97.     switch( key )
  98.     {
  99.         case TUNE_HYDRAULICS_LEFT:
  100.         {
  101.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 0 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  102.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.0, 0.035, 0.0 ) );
  103.  
  104.             return;
  105.         }
  106.         case TUNE_HYDRAULICS_LEFT2:
  107.         {
  108.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 1 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  109.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.0, 0.035, 0.0 ) );
  110.  
  111.             return;
  112.         }
  113.        
  114.         case TUNE_HYDRAULICS_RIGHT:
  115.         {
  116.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 0 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  117.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.0, -0.035, 0.0 ) );
  118.  
  119.             return;
  120.         }
  121.         case TUNE_HYDRAULICS_RIGHT2:
  122.         {
  123.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 1 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  124.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.0, -0.035, 0.0 ) );
  125.  
  126.             return;
  127.         }
  128.        
  129.         case TUNE_HYDRAULICS_DOWN:
  130.         {
  131.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 0 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  132.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.06, 0.0, 0.0 ) );
  133.  
  134.             return;
  135.         }
  136.         case TUNE_HYDRAULICS_DOWN2:
  137.         {
  138.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 1 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  139.                 player.Vehicle.AddRelTurnSpeed( Vector( 0.06, 0.0, 0.0 ) );
  140.  
  141.             return;
  142.         }
  143.        
  144.         case TUNE_HYDRAULICS_UP:
  145.         {
  146.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 0 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  147.                 player.Vehicle.AddRelTurnSpeed( Vector( -0.06, 0.0, 0.0 ) );
  148.  
  149.             return;
  150.         }
  151.         case TUNE_HYDRAULICS_UP2:
  152.         {
  153.             if( player.Vehicle && VehType( player.Vehicle.Model ) == "Car" && tuneHydraulicsVariant[ player.ID ] == 1 && tuneHydraulicsEnabled[ player.Vehicle.ID ] == 1 )
  154.                 player.Vehicle.AddRelTurnSpeed( Vector( -0.06, 0.0, 0.0 ) );
  155.  
  156.             return;
  157.         }
  158.         default: break;
  159.     }
  160. }
  161.  
  162. function tuneExitMenu( player )
  163. {
  164.     local veh = player.Vehicle;
  165.     if( !veh ) return;
  166.     else
  167.     {
  168.         player.World = 0;
  169.         veh.World = player.World;
  170.         player.Vehicle = veh;
  171.         player.RestoreCamera();
  172.                
  173.         veh.Pos = tuneSavedPos[ player.ID ];
  174.         veh.EulerAngle = tuneSavedAngle[ player.ID ];
  175.     }
  176. }
  177.  
  178. function tuneEnterSubmenu( player, menuID, submenuID )
  179. {
  180.     switch( menuID )
  181.     {
  182.         case tuneMenuID:    // first menu
  183.             switch( submenuID )
  184.             {
  185.                 case 4:
  186.                     player.SetCameraPos( TUNE_CAMERA_TOP_FRONT, TUNE_CAMERA_LOOK );
  187.                     break;
  188.                 case 5:
  189.                     player.SetCameraPos( TUNE_CAMERA_SIDE, TUNE_CAMERA_LOOK );
  190.                     break;
  191.                 default: break;
  192.             }
  193.             break;
  194.         case tuneSecondMenuID:  // second menu
  195.             switch( submenuID )
  196.             {
  197.                 case 3:
  198.                     if( VehType( player.Vehicle.Model ) != "Car" && VehType( player.Vehicle.Model ) != "Bike" )
  199.                         {
  200.                         menu[ tuneSecondMenuID ].HideSubmenu( player, submenuID );
  201.                         ::MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorError + " [ Error ] " + tuneColorText + "This option is only for cars and bikes !", player );
  202.                         }
  203.                     break;
  204.                 case 4:
  205.                     tuneEnterSubmenu( player, tuneMenuID, 4 );
  206.                     break;
  207.             }
  208.             break;
  209.         default: break;
  210.     }
  211. }
  212.  
  213. function tuneSwitchOptionsInSubmenu( player, menuID, submenuID, oldOption, newOption )
  214. {
  215.     switch( menuID )
  216.     {
  217.         case tuneMenuID:
  218.             switch( submenuID )
  219.             {
  220.                 case 3: // Front & Rear Bumpers
  221.                     switch( newOption )
  222.                     {
  223.                         case 1:
  224.                             player.SetCameraPos( TUNE_CAMERA_FRONT, TUNE_CAMERA_LOOK );
  225.                             break;
  226.                         case 2:
  227.                             player.SetCameraPos( TUNE_CAMERA_REAR, TUNE_CAMERA_LOOK );
  228.                             break;
  229.                         default: break;
  230.                     }
  231.                     break;
  232.                 case 6: // Custom Lights
  233.                     switch( newOption )
  234.                     {
  235.                         case 1:
  236.                         case 2:
  237.                         case 3:
  238.                             player.SetCameraPos( TUNE_CAMERA_TOP, TUNE_CAMERA_LOOK );
  239.                             break;
  240.                         case 4:
  241.                         case 5:
  242.                         case 8:
  243.                             player.SetCameraPos( TUNE_CAMERA_TOP_FRONT, TUNE_CAMERA_LOOK );
  244.                             break;
  245.                         case 6:
  246.                         case 7:
  247.                         case 9:
  248.                         case 10:
  249.                             player.SetCameraPos( TUNE_CAMERA_REAR, TUNE_CAMERA_LOOK );
  250.                             break;
  251.                         default: break;
  252.                     }
  253.                     break;
  254.                 case 7: // Trunk & Hood
  255.                     switch( newOption )
  256.                     {
  257.                         case 1:
  258.                             player.SetCameraPos( TUNE_CAMERA_TOP_REAR, TUNE_CAMERA_LOOK );
  259.                             break;
  260.                         case 2:
  261.                             player.SetCameraPos( TUNE_CAMERA_TOP_FRONT, TUNE_CAMERA_LOOK );
  262.                             break;
  263.                         default: break;
  264.                     }
  265.                     break;
  266.                 default: break;
  267.             }
  268.             break;
  269.         case tuneSecondMenuID:
  270.             switch( submenuID )
  271.             {
  272.                 case 3:
  273.                     tuneSwitchOptionsInSubmenu( player, tuneMenuID, 6, oldOption, newOption );
  274.                     break;
  275.                 default: break;
  276.             }
  277.             break;
  278.         default: break;
  279.     }
  280. }
  281.  
  282. function tuneSelectInMenu( player, menuID, option )
  283. {
  284.         switch( option )
  285.             {
  286.                 case 8: // Hydraulics
  287.                     if( tuneHydraulicsEnabled[ player.Vehicle.ID ] == 0 )
  288.                     {
  289.                         tuneHydraulicsEnabled[ player.Vehicle.ID ] = 1;
  290.                         if( tuneHydraulicsVariant[ player.ID ] == 0 ) MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Hydraulics were " + tuneColorEnabled + "enabled" + tuneColorText + " ! Use " + tuneColorEnabled + "NUMPADs 8, 2, 4, 6" + tuneColorText + " !", player );
  291.                         else MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Hydraulics were " + tuneColorEnabled + "enabled" + tuneColorText + " ! " + tuneColorEnabled + "Use U, J, H, K" + tuneColorText + " !", player );
  292.                         MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " If you don't enjoy the combination, use " + tuneColorEnabled + "/hydraulicskeys" + tuneColorText + " to change it !", player );
  293.                     }
  294.                     else
  295.                     {
  296.                         tuneHydraulicsEnabled[ player.Vehicle.ID ] = 0;
  297.                         MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Hydraulics were " + tuneColorDisabled + "disabled" + tuneColorText + " !", player );
  298.                     }
  299.                     break;
  300.                 case 9: // Firetruk's Handling
  301.                     player.Vehicle.SetHandlingData( 1, 6500 );
  302.                     player.Vehicle.SetHandlingData( 2, 2.9 );
  303.                     player.Vehicle.SetHandlingData( 3, 7.7 );
  304.                     player.Vehicle.SetHandlingData( 4, 3.8 );
  305.                     player.Vehicle.SetHandlingData( 5, 0 );
  306.                     player.Vehicle.SetHandlingData( 6, 0 );
  307.                     player.Vehicle.SetHandlingData( 7, 0 );
  308.                     player.Vehicle.SetHandlingData( 8, 90 );
  309.                     player.Vehicle.SetHandlingData( 9, 0.65 );
  310.                     player.Vehicle.SetHandlingData( 10, 0.7 );
  311.                     player.Vehicle.SetHandlingData( 11, 0.5 );
  312.                     player.Vehicle.SetHandlingData( 12, 5 );
  313.                     player.Vehicle.SetHandlingData( 13, 170 );
  314.                     player.Vehicle.SetHandlingData( 14, 22 );
  315.                     player.Vehicle.SetHandlingData( 15, 82 );
  316.                     player.Vehicle.SetHandlingData( 16, 68 );
  317.                     player.Vehicle.SetHandlingData( 17, 10 );
  318.                     player.Vehicle.SetHandlingData( 18, 0.45 );
  319.                     player.Vehicle.SetHandlingData( 19, 27 );
  320.                     player.Vehicle.SetHandlingData( 20, 1.2 );
  321.                     player.Vehicle.SetHandlingData( 21, 0.08 );
  322.                     player.Vehicle.SetHandlingData( 22, 0.2 );
  323.                     player.Vehicle.SetHandlingData( 23, 0.26 );
  324.                     player.Vehicle.SetHandlingData( 24, 0.47 );
  325.                     player.Vehicle.SetHandlingData( 25, -0.17 );
  326.                     player.Vehicle.SetHandlingData( 26, 0.5 );
  327.                     player.Vehicle.SetHandlingData( 27, 0 );
  328.                     player.Vehicle.SetHandlingData( 28, 17412 );
  329.                     player.Vehicle.SetHandlingData( 29, 0 );
  330.                     player.Vehicle.SetHandlingData( 30, 1 );
  331.                     MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Firetruk's Handling " + tuneColorEnabled + "applied" + tuneColorText + " to your car !", player );
  332.                     break;
  333.                 case 10: // Deluxo's Handling
  334.                     player.Vehicle.SetHandlingData( 1, 1600 );
  335.                     player.Vehicle.SetHandlingData( 2, 2.2 );
  336.                     player.Vehicle.SetHandlingData( 3, 4.9 );
  337.                     player.Vehicle.SetHandlingData( 4, 1.7 );
  338.                     player.Vehicle.SetHandlingData( 5, 0 );
  339.                     player.Vehicle.SetHandlingData( 6, 0 );
  340.                     player.Vehicle.SetHandlingData( 7, 0.2 );
  341.                     player.Vehicle.SetHandlingData( 8, 75 );
  342.                     player.Vehicle.SetHandlingData( 9, 0.8 );
  343.                     player.Vehicle.SetHandlingData( 10, 0.85 );
  344.                     player.Vehicle.SetHandlingData( 11, 0.52 );
  345.                     player.Vehicle.SetHandlingData( 12, 5 );
  346.                     player.Vehicle.SetHandlingData( 13, 200 );
  347.                     player.Vehicle.SetHandlingData( 14, 26 );
  348.                     player.Vehicle.SetHandlingData( 15, 52 );
  349.                     player.Vehicle.SetHandlingData( 16, 80 );
  350.                     player.Vehicle.SetHandlingData( 17, 10 );
  351.                     player.Vehicle.SetHandlingData( 18, 0.53 );
  352.                     player.Vehicle.SetHandlingData( 19, 30 );
  353.                     player.Vehicle.SetHandlingData( 20, 2.25 );
  354.                     player.Vehicle.SetHandlingData( 21, 0.16 );
  355.                     player.Vehicle.SetHandlingData( 22, 0.28 );
  356.                     player.Vehicle.SetHandlingData( 23, 0.52 );
  357.                     player.Vehicle.SetHandlingData( 24, 0.27 );
  358.                     player.Vehicle.SetHandlingData( 25, -0.16 );
  359.                     player.Vehicle.SetHandlingData( 26, 0.5 );
  360.                     player.Vehicle.SetHandlingData( 27, 0.35 );
  361.                     player.Vehicle.SetHandlingData( 28, 33154 );
  362.                     player.Vehicle.SetHandlingData( 29, 0 );
  363.                     player.Vehicle.SetHandlingData( 30, 1 );
  364.                     MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Deluxo's Handling " + tuneColorEnabled + "applied" + tuneColorText + " to your car !", player);
  365.                     break;
  366.                 default: break;
  367.             }
  368. }
  369.  
  370. function tuneSelectInSubmenu( player, menuID, submenuID, option )
  371. {
  372.     switch( menuID )
  373.     {
  374.         case tuneMenuID:
  375.             switch( submenuID )
  376.             {
  377.                 case 1:
  378.                     switch ( option )
  379.                     {
  380.                         case 1:
  381.                             player.Vehicle.Colour1 = 0;
  382.                             break;
  383.                         case 2:
  384.                             player.Vehicle.Colour1 = 1;
  385.                             break;
  386.                         case 3:
  387.                             player.Vehicle.Colour1 = 66;
  388.                             break;
  389.                         case 4:
  390.                             player.Vehicle.Colour1 = 14;
  391.                             break;
  392.                         case 5:
  393.                             player.Vehicle.Colour1 = 46;
  394.                             break;
  395.                         case 6:
  396.                             player.Vehicle.Colour1 = 50;
  397.                             break;
  398.                         case 7:
  399.                             player.Vehicle.Colour1 = 6;
  400.                             break;
  401.                         case 8:
  402.                             player.Vehicle.Colour1 = 5;
  403.                             break;
  404.                         case 9:
  405.                             if( player.Vehicle.Colour1 == 94 ) player.Vehicle.Colour1 = 0;
  406.                             else player.Vehicle.Colour1 += 1;
  407.                             break;
  408.                         default:
  409.                             if( player.Vehicle.Colour1 == 0 ) player.Vehicle.Colour1 = 94;
  410.                             else player.Vehicle.Colour1 -= 1;
  411.                             break;
  412.                     }
  413.                     break;
  414.                 case 2:
  415.                     switch ( option )
  416.                     {
  417.                         case 1:
  418.                             player.Vehicle.Colour2 = 0;
  419.                             break;
  420.                         case 2:
  421.                             player.Vehicle.Colour2 = 1;
  422.                             break;
  423.                         case 3:
  424.                             player.Vehicle.Colour2 = 66;
  425.                             break;
  426.                         case 4:
  427.                             player.Vehicle.Colour2 = 14;
  428.                             break;
  429.                         case 5:
  430.                             player.Vehicle.Colour2 = 46;
  431.                             break;
  432.                         case 6:
  433.                             player.Vehicle.Colour2 = 50;
  434.                             break;
  435.                         case 7:
  436.                             player.Vehicle.Colour2 = 6;
  437.                             break;
  438.                         case 8:
  439.                             player.Vehicle.Colour2 = 5;
  440.                             break;
  441.                         case 9:
  442.                             if( player.Vehicle.Colour2 == 94 ) player.Vehicle.Colour2 = 0;
  443.                             else player.Vehicle.Colour2 += 1;
  444.                             break;
  445.                         default:
  446.                             if( player.Vehicle.Colour2 == 0 ) player.Vehicle.Colour2 = 94;
  447.                             else player.Vehicle.Colour2 -= 1;
  448.                             break;
  449.                     }
  450.                     break;
  451.                 case 3:
  452.                     switch( option )
  453.                     {
  454.                         case 1:
  455.                             if( player.Vehicle.GetPart( 0 ) != 0 )
  456.                             {
  457.                                 player.Vehicle.SetPart( 0, 0 );
  458.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Front Bumper was " + tuneColorEnabled + "re-added" + tuneColorText + " !", player);
  459.                             }
  460.                             else
  461.                             {
  462.                                 player.Vehicle.SetPart( 0, 3 );
  463.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Front Bumper was " + tuneColorDisabled + "removed" + tuneColorText + " !", player);
  464.                             }
  465.                             break;
  466.                         default:
  467.                             if( player.Vehicle.GetPart( 1 ) != 0 )
  468.                             {
  469.                                 player.Vehicle.SetPart( 1, 0 );
  470.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear Bumper was " + tuneColorEnabled + "re-added" + tuneColorText + " !", player);
  471.                             }
  472.                             else
  473.                             {
  474.                                 player.Vehicle.SetPart( 1, 3 );
  475.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear Bumper was " + tuneColorDisabled + "removed" + tuneColorText + " !", player);
  476.                             }
  477.                             break;
  478.                     }
  479.                     break;
  480.                 case 4:
  481.                     switch( option )
  482.                     {
  483.                         case 1:
  484.                             if( player.Vehicle.GetHandlingData( 14 ) < TUNE_LIMIT_ACCELERATION )
  485.                             {
  486.                                 player.Vehicle.SetHandlingData( 14, player.Vehicle.GetHandlingData( 14 ) + 5 );
  487.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Acceleration " + tuneColorEnabled + "increased" + tuneColorText + " ! (new: " + player.Vehicle.GetHandlingData( 14 ) + ")", player);
  488.                             }
  489.                             else MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorError + " [ Error ] " + tuneColorText + "The acceleration touched the limit !", player );
  490.                             break;
  491.                         case 2:
  492.                             if( player.Vehicle.GetHandlingData( 13 ) < TUNE_LIMIT_MAXSPEED )
  493.                             {
  494.                                 player.Vehicle.SetHandlingData( 13, player.Vehicle.GetHandlingData( 13 ) + 5 );
  495.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Max Speed " + tuneColorEnabled + "increased" + tuneColorText + " !", player);
  496.                             }
  497.                             else MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorError + " [ Error ] " + tuneColorText + "The engine fails in increasing the max speed ! (new: " + player.Vehicle.GetHandlingData( 13 ) + ")", player );
  498.                             break;
  499.                         case 3:
  500.                             player.Vehicle.SetHandlingData( 9, player.Vehicle.GetHandlingData( 9 ) * 1.4 );
  501.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Traction was " + tuneColorEnabled + "upgraded" + tuneColorText + " ! (new: " + player.Vehicle.GetHandlingData( 9 ) + ")", player);
  502.                             break;
  503.                         case 4:
  504.                             player.Vehicle.SetHandlingData( 17, player.Vehicle.GetHandlingData( 17 ) * 1.4 );
  505.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Brakes were " + tuneColorEnabled + "upgraded" + tuneColorText + " ! (new: " + player.Vehicle.GetHandlingData( 17 ) + ")", player);
  506.                             break;
  507.                         case 5:
  508.                             if( player.Vehicle.GetHandlingData( 33 ) == 0 )
  509.                             {
  510.                                 player.Vehicle.SetHandlingData( 33, 1 );
  511.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Drive on Water was " + tuneColorEnabled + "enabled" + tuneColorText + " !", player);
  512.                             }
  513.                             else
  514.                             {
  515.                                 player.Vehicle.SetHandlingData( 33, 0.0 );
  516.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Drive on Water was " + tuneColorDisabled + "disabled" + tuneColorText + " !", player);
  517.                             }
  518.                             break;
  519.                         default: break;
  520.                     }
  521.                     break;
  522.                 case 5:
  523.                     switch(option)
  524.                     {
  525.                         case 1:
  526.                             if( player.Vehicle.GetHandlingData( 24 ) > -0.1 )
  527.                             {
  528.                                 player.Vehicle.SetHandlingData( 24, player.Vehicle.GetHandlingData( 24 ) - 0.1 );
  529.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension became " + tuneColorEnabled + "higher" + tuneColorText + " !", player );
  530.                             }
  531.                             else MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorError + " [ Error ] " + tuneColorText + "Suspension touched the limit !", player );
  532.                             break;
  533.                         case 2:
  534.                             player.Vehicle.SetHandlingData( 24, player.Vehicle.GetHandlingData( 24 ) + 0.1 );
  535.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension became " + tuneColorDisabled + "lower" + tuneColorText + " !", player );
  536.                             break;
  537.                         case 3:
  538.                             player.Vehicle.SetHandlingData(24, 0 );
  539.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension was set to " + tuneColorEnabled + "High Level" + tuneColorText + " !", player );
  540.                             break;
  541.                         case 4:
  542.                              player.Vehicle.SetHandlingData(24, 0.5 );
  543.                              MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension was set to " + tuneColorEnabled + "Medium Level" + tuneColorText + " !", player );
  544.                             break;
  545.                         case 5:
  546.                             player.Vehicle.SetHandlingData(24, 1.0 );
  547.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension was set to " + tuneColorEnabled + "Low Level" + tuneColorText + " !", player );
  548.                             break;
  549.                         case 6:
  550.                             player.Vehicle.SetHandlingData(24, 1.2);
  551.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Car's suspension was set to " + tuneColorEnabled + "Lowest Level" + tuneColorText + " !", player );
  552.                             break;
  553.                         case 7:
  554.                             player.Vehicle.SetHandlingData( 26, player.Vehicle.GetHandlingData( 26 ) - 0.05 );
  555.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " The bias suspension was " + tuneColorEnabled + "increased" + tuneColorText + " !", player );
  556.                             break;
  557.                         case 8:
  558.                             player.Vehicle.SetHandlingData( 26, player.Vehicle.GetHandlingData( 26 ) + 0.05 );
  559.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " The bias suspension was " + tuneColorDisabled + "decreased" + tuneColorText + " !", player );
  560.                             break;
  561.                         default: break;
  562.                     }
  563.                     break;
  564.                 case 6:
  565.                     switch(option)
  566.                     {
  567.                         case 1:
  568.                             player.Vehicle.SetHandlingData( 29, 20 );
  569.                             player.Vehicle.SetHandlingData( 30, 20 );
  570.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Lights' boxes were " + tuneColorDisabled + "disabled" + tuneColorText + " !", player );
  571.                             break;
  572.                         case 2:
  573.                             player.Vehicle.SetHandlingData( 29, player.Vehicle.GetHandlingData( 29 ) + 1 );
  574.                             player.Vehicle.SetHandlingData( 30, player.Vehicle.GetHandlingData( 30 ) + 1 );
  575.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Both lights' boxes were changed to the next type !", player );
  576.                             break;
  577.                         case 3:
  578.                             player.Vehicle.SetHandlingData( 29, player.Vehicle.GetHandlingData( 29 ) - 1 );
  579.                             player.Vehicle.SetHandlingData( 30, player.Vehicle.GetHandlingData( 30 ) - 1 );
  580.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Both lights' boxes were changed to the previous type !", player );
  581.                             break;
  582.                         case 4:
  583.                             player.Vehicle.SetHandlingData(29,-3);
  584.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Front light was upgraded with a [#74FF24]green " + tuneColorText + " color !", player );
  585.                             break;
  586.                         case 5:
  587.                             player.Vehicle.SetHandlingData(29,-2);
  588.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Front light was upgraded with an [#FF9924]orange " + tuneColorText + "color !", player );
  589.                             break;
  590.                         case 6:
  591.                             player.Vehicle.SetHandlingData(30,-7);
  592.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear light was upgraded with a [#74FF24]green " + tuneColorText + " color !", player );
  593.                             break;
  594.                         case 7:
  595.                             player.Vehicle.SetHandlingData(30,-5);
  596.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear light was upgraded with a [#FF0000]red " + tuneColorText + "color !", player );
  597.                             break;
  598.                         case 8:
  599.                             player.Vehicle.SetHandlingData(30,-6);
  600.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear light was upgraded with an [#FF9924]orange " + tuneColorText + "color !", player );
  601.                             break;
  602.                         case 9:
  603.                             player.Vehicle.SetHandlingData( 29, player.Vehicle.GetHandlingData( 29 ) );
  604.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Front light was set to default !", player );
  605.                             break;
  606.                         case 10:
  607.                             player.Vehicle.SetHandlingData( 30, player.Vehicle.GetHandlingData( 30 ) );
  608.                             MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Rear light was set to default !", player );
  609.                             break;
  610.                         default: break;
  611.                     }
  612.                     break;
  613.                 case 7:
  614.                     switch( option )
  615.                     {
  616.                         case 1:
  617.                             if( player.Vehicle.GetPart( 9 ) != 0 )
  618.                             {
  619.                                 player.Vehicle.SetPart( 9, 0 );
  620.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Trunk has been " + tuneColorEnabled + "re-added" + tuneColorText + " !", player );
  621.                             }
  622.                             else
  623.                             {
  624.                                 player.Vehicle.SetPart( 9, 3 );
  625.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Trunk has been " + tuneColorDisabled + "removed" + tuneColorText + " !", player );
  626.                             }
  627.                             break;
  628.                         default:
  629.                             if( player.Vehicle.GetPart( 8 ) != 0 )
  630.                             {
  631.                                 player.Vehicle.SetPart( 8, 0 );
  632.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Hood has been " + tuneColorEnabled + "re-added" + tuneColorText + " !", player );
  633.                             }
  634.                             else
  635.                             {
  636.                                 player.Vehicle.SetPart( 8, 3 );
  637.                                 MessagePlayer( tuneColorPrefix + "[ Tuning ]" + tuneColorText + " Hood has been " + tuneColorDisabled + "removed" + tuneColorText + " !", player );
  638.                             }
  639.                             break;
  640.                     }
  641.                     break;
  642.                 default: break;
  643.             }
  644.             break;
  645.         case tuneSecondMenuID:
  646.             switch( submenuID )
  647.             {
  648.                 case 1:
  649.                 case 2:
  650.                 case 4:
  651.                     tuneSelectInSubmenu( player, tuneMenuID, submenuID, option );
  652.                     break;
  653.                 case 3:
  654.                     tuneSelectInSubmenu( player, tuneMenuID, 6, option );
  655.                     break;
  656.                 default: break;
  657.             }
  658.             break;
  659.         default: break;
  660.     }
  661. }
  662.  
  663. function VehType( model ) {
  664.     switch ( model ) {
  665.         case 136:
  666.         case 160:
  667.         case 176:
  668.         case 182:
  669.         case 183:
  670.         case 184:
  671.         case 202:
  672.         case 203:
  673.         case 214:
  674.         case 223:
  675.             return "Boat";
  676.         case 155:
  677.         case 177:
  678.         case 199:
  679.         case 217:
  680.         case 218:
  681.         case 227:
  682.             return "Heli";
  683.         case 166:
  684.         case 178:
  685.         case 191:
  686.         case 192:
  687.         case 193:
  688.         case 198:
  689.             return "Bike";
  690.         case 171:
  691.         case 194:
  692.         case 195:
  693.         case 231:
  694.             return "RC";
  695.         case 190:
  696.             return "Plane";
  697.         default:
  698.             return "Car";
  699.     }
  700. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement