Jump to content

I want to change the sounds of car. HELP!!!


QoRaY

Recommended Posts

Well then ofc i belive you could use timers, so the first timer trigger when the player presses W and after he have held it for lets say 3 sec it changes to higher rpm sound and so it goes.

And just to tell you, everything on youtube isnt real, editing a video to change the vehicle sound isnt hard.

Link to comment

it's possible but is not easy :

Example :

  
function enable ( ) 
addEventHandler ( "onClientRender", getRootElement(), getSpeed ) 
end 
addEventHandler ("onClientVehicleEnter", getRootElement(), enable) 
  
function disable ( ) 
removeEventHandler ( "onClientRender", getRootElement(),getSpeed ) 
end 
addEventHandler("onClientVehicleExit", getRootElement(), disable) 
  

  
function getSpeed () 
sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) 
speed = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180)  
end 
  

  
function playSoundSpeed () -- need onClientRender 
if speed == 0 then 
-- play sound 
elseif speed > 2 then 
-- play sound gear 1 
-- etc... 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...