Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------ A correclty functional NOS option for GTA 5 ------
- //
- // Activates on horn press
- // Has sound effects as well as screen effects
- // AddSpeed variable allows you to set how much speed we need to add
- //
- // VehicleNOS is our Bool to Set
- //-------------------------------------------------------------
- Bool VehicleNOS;
- int NosTimer = 0;
- int AddSpeed = 50; // Range of 0 to 100 is advised
- VehicleNOS() // Function needs to be in loop
- {
- int NosTimer = 0;
- int AddSpeed = 50; // Range of 0 to 100 is advised
- if (NOSonHorn)
- {
- int veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(),0);
- if ((PLAYER::IS_PLAYER_PRESSING_HORN(PLAYER::PLAYER_ID())) && (GAMEPLAY::GET_GAME_TIMER() > NosTimer) && (VEHICLE::IS_VEHICLE_ON_ALL_WHEELS(veh)))
- {
- int NosTimer = GAMEPLAY::GET_GAME_TIMER() + 2000;
- AUDIO::SET_VEHICLE_BOOST_ACTIVE(veh, 1); // Add sound effect
- GRAPHICS::_START_SCREEN_EFFECT("RaceTurbo", 0, 0); // Add Screen effect
- float Speed = ENTITY::GET_ENTITY_SPEED(veh) + (float)AddSpeed; // Calculate new speed
- VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, Speed); // Set new speed
- }
- else if ((GAMEPLAY::GET_GAME_TIMER() <= NosTimer))
- {
- AUDIO::SET_VEHICLE_BOOST_ACTIVE(veh, 0); // Remove Sound effect after 2 seconds
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement