denny199 Posted July 30, 2011 Share Posted July 30, 2011 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
Castillo Posted July 30, 2011 Share Posted July 30, 2011 There's a topic about this, maybe it helps you: https://forum.multitheftauto.com/viewtop ... a5#p342602 Link to comment
bandi94 Posted July 30, 2011 Share Posted July 30, 2011 yes bk playSound3D is clients side = only that client (player) hear it Link to comment
Castillo Posted July 30, 2011 Share Posted July 30, 2011 bandi, as you can see he's triggering the event to getRootElement(). Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now