Sign in to follow this  
#TeKa

مساعدة في playSound

Recommended Posts

السلام عليكم ..

في مشكلة عندي 
ال Sound = بتشتغل  تمام 
ولكن لما اكتب stopsound 
ما تتوقف 
 

--DeBug
Bad argument @ 'stopSound' [Expected sound at argument 1, got nil]
--This_Code_Client
addEventHandler("onClientResourceStart",getRootElement(),
function ()
    local sounds = playSound("song.mp3")
	setSoundVolume(sounds, 0.5)
end)

function stop ( )
stopSound( sounds )
end
addCommandHandler("stopsound",stop)

 

Share this post


Link to post
addEventHandler("onClientResourceStart",getRootElement(),

function ()
sounds = playSound("song.mp3")
setSoundVolume(sounds, 0.5)
end
)



function stop ( )
if isElement(sounds) then 
stopSound(sounds)

end
end
addCommandHandler("stopsound",stop)

 

Share this post


Link to post

حدث تشغيل المود بالكليننت ماله داعي هنا

 

Share this post


Link to post
13 hours ago, #TeKa said:

السلام عليكم ..

في مشكلة عندي 
ال Sound = بتشتغل  تمام 
ولكن لما اكتب stopsound 
ما تتوقف 
 


--DeBug
Bad argument @ 'stopSound' [Expected sound at argument 1, got nil]

--This_Code_Client
addEventHandler("onClientResourceStart",getRootElement(),
function ()
    local sounds = playSound("song.mp3")
	setSoundVolume(sounds, 0.5)
end)

function stop ( )
stopSound( sounds )
end
addCommandHandler("stopsound",stop)

 

جرب :
 

-- Client
addEventHandler("onClientResourceStart",resourceRoot,
function ()
    sounds = playSound("song.mp3")
	setSoundVolume(sounds, 0.5)
end
)

function stop ( )
stopSound ( sounds )
end
addCommandHandler("stopsound",stop)

 

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.