Xwad Posted July 28, 2015 Author Share Posted July 28, 2015 now its working but ts another problem again my god. When i die the sound dont stops:/ Link to comment
GTX Posted July 28, 2015 Share Posted July 28, 2015 local sound setTimer(function() if isPedDead(localPlayer) then return end local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getElementModel(vehicle) ~= 476 then local vx,vy,vz = getElementVelocity(vehicle) if vx+vy+vz == 0 then if sound then setSoundPaused(sound,true) end else if not sound then sound = playSound("sounds/sound.mp3") setSoundVolume(sound, 0.1) else setSoundPaused(sound,false) end end elseif sound then setSoundPaused(sound,true) end end,1000,0) function stopSound() setSoundPaused(sound, true) end addEventHandler("onClientPlayerWasted", root, stopSound) Link to comment
Buffalo Posted July 28, 2015 Share Posted July 28, 2015 local sound setTimer(function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getElementModel(vehicle) ~= 476 then local vx,vy,vz = getElementVelocity(vehicle) if vx+vy+vz == 0 then if sound then setSoundPaused(sound,true) end else if not sound then sound = playSound("sounds/sound.mp3") setSoundVolume(sound, 0.1) else setSoundPaused(sound,false) end end elseif sound then setSoundPaused(sound,true) end end,1000,0) --anonymous function attached to you addEventHandler("onClientPlayerWasted", localPlayer, function() if isElement(sound) then setSoundPaused(sound, true) end end) Link to comment
Xwad Posted July 28, 2015 Author Share Posted July 28, 2015 finaly now its working! tanks again!! Link to comment
Xwad Posted July 31, 2015 Author Share Posted July 31, 2015 shit its bugging again!! I play and after a few minutes the sound dont works anymore and this is the debug script: WARNING: sound/client.lua:9 Bad 'sound/player' pointer @ 'setSoundPaused'(1) and if i press w then it says WARNING: sound/client.lua:16 Bad 'sound/player' pointer @ 'setSoundPaused'(1) pls help! 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