Advertisement
KiLLerBoy_001

GTA 5: NOS on Horn

Nov 19th, 2015
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. //------------ A correclty functional NOS option for GTA 5 ------
  2. //
  3. // Activates on horn press
  4. // Has sound effects as well as screen effects
  5. // AddSpeed variable allows you to set how much speed we need to add
  6. //
  7. // VehicleNOS is our Bool to Set
  8. //-------------------------------------------------------------
  9.  
  10. Bool VehicleNOS;
  11. int NosTimer = 0;
  12. int AddSpeed = 50;  // Range of 0 to 100 is advised
  13.  
  14. VehicleNOS()        // Function needs to be in loop
  15. {
  16.     int NosTimer = 0;
  17.     int AddSpeed = 50;  // Range of 0 to 100 is advised
  18.     if (NOSonHorn)
  19.     {
  20.         int veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(),0);
  21.         if ((PLAYER::IS_PLAYER_PRESSING_HORN(PLAYER::PLAYER_ID())) && (GAMEPLAY::GET_GAME_TIMER() > NosTimer) && (VEHICLE::IS_VEHICLE_ON_ALL_WHEELS(veh)))
  22.         {
  23.             int NosTimer = GAMEPLAY::GET_GAME_TIMER() + 2000;
  24.             AUDIO::SET_VEHICLE_BOOST_ACTIVE(veh, 1);                       // Add sound effect
  25.             GRAPHICS::_START_SCREEN_EFFECT("RaceTurbo", 0, 0);             // Add Screen effect
  26.             float Speed = ENTITY::GET_ENTITY_SPEED(veh) + (float)AddSpeed;         // Calculate new speed
  27.             VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, Speed);                  // Set new speed
  28.         }
  29.         else if ((GAMEPLAY::GET_GAME_TIMER() <= NosTimer))
  30.         {
  31.             AUDIO::SET_VEHICLE_BOOST_ACTIVE(veh, 0);                       // Remove Sound effect after 2 seconds
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement