Paplo Posted August 27, 2013 Share Posted August 27, 2013 hi local vehicle = getPedOccupiedVehicle ( localPlayer ) localPlayer = Checks player himself But I want checks from other players and not checks player himself Link to comment
TAPL Posted August 27, 2013 Share Posted August 27, 2013 This depend on the event you'll use, or maybe you just want to use getPlayerFromName. Link to comment
Paplo Posted August 27, 2013 Author Share Posted August 27, 2013 addEventHandler("onClientVehicleEnter", getRootElement(), function () local vehicle = getPedOccupiedVehicle ( localPlayer ) local x,y,z = getElementPosition( vehicle ) local collision = createColSphere ( x, y, z, 10.0 ) local playersincol = getElementsWithinColShape( collision, "player" ) sound = playSound3D( "music.mp3", x, y, z, true ) setSoundVolume( sound, 5 ) setSoundMaxDistance( sound, 20 ) attachElements ( sound, vehicle ) attachElements ( collision, vehicle ) end ) addEventHandler("onClientVehicleExit", getRootElement(), function(thePlayer, seat) if thePlayer == getLocalPlayer() then stopSound ( sound ) end end ) i want to all player hears the sound if close to vehicle 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