Jump to content

Help me please with this code


denny199

Recommended Posts

Hi there,

I've got last a few questions on my server - NL server they asked to me to make a new police horn like the netherlands and then this:I've got attached the playsound on the vehicle - 3D but now you hear it only who has entered the police car help me code:

Client:

-- client 
function policeEnterr (player) 
 local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) 
politiet = playSound3D("hooh1.mp3", 0, 0, 0, true)  
attachElements ( politiet, vehicle ) 
        setSoundMaxDistance(politiet, 45) 
        setSoundVolume(politiet, 30.0) 
end 
addEvent( "police", true ) 
addEventHandler( "police", getRootElement(), policeEnterr ) 

-=-=-=Server-=-=-=-==-=-=-

-- server 
function policeEnter ( theVehicle, seat, jacked )  
    local id = getElementModel ( theVehicle )  
    if id == 546 or id == 568 or id == 537 then  
        local vehicleName = getVehicleName ( theVehicle )  
    triggerClientEvent ( "police", getRootElement() ) 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), policeEnter ) 

please help!

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...