[PXG]Blue Posted April 7, 2015 Share Posted April 7, 2015 I want to trigger "onClientRender" with the Local Player because of setSoundVolume and playSound, but if i trigger it, nothing happenes, and if i use root, it happens for everyone any ideas? Link to comment
ahmedo01 Posted April 7, 2015 Share Posted April 7, 2015 Trigger to clientside from server. When you triggering triggerClientEvent(playerlistensvoice,args.....) I think you can use this way. Link to comment
[PXG]Blue Posted April 7, 2015 Author Share Posted April 7, 2015 Any code? song = playSound("ambient_fly.mp3", true ) setSoundVolume( song, 0 ) local turn = true -- unfaded by default function startFlyAmbientSound(player,seat) vehid = getElementModel(getPedOccupiedVehicle(localPlayer)) if vehid == 520 then removeEventHandler("onClientRender", root, renderFade) turn = true addEventHandler("onClientRender",root,renderFade) end end addEventHandler("onClientVehicleEnter", root, startFlyAmbientSound ) Renderfate is just the Fading of the sound, its basicly setSoundVolume Link to comment
Et-win Posted April 7, 2015 Share Posted April 7, 2015 function startFlyAmbientSound(player,seat) if (player == localPlayer) then vehid = getElementModel(getPedOccupiedVehicle(localPlayer)) if vehid == 520 then removeEventHandler("onClientRender", root, renderFade) turn = true addEventHandler("onClientRender",root,renderFade) end end end addEventHandler("onClientVehicleEnter", root, startFlyAmbientSound ) Simply check if the entering player is the localPlayer 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