Jump to content

[help] playSound3D and stopSound


#RooTs

Recommended Posts

Posted

Hello friends. how can I use this function to start and stop when I want?

local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false)  

good. I imagine that I can use these functions

local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false) 
  
function playMySound() 
    playSound( sound ) 
end 
addCommandHandler ( "playsound", playMySound ) 
  
function stopMySound() 
    stopSound( sound ) 
end 
addCommandHandler ( "stopsound", stopMySound ) 

is correct? what I have to do to. stop or start my sound in 3D?

 DUyJ810.gif

Posted
function sounFunction(cmd) 
    if cmd == "playsound" then  
        if isElement(sound) then  
            stopSound( sound ) 
        end  
        sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false) 
    elseif cmd == "stopsound" then  
        if isElement(sound) then  
            stopSound( sound ) 
        end  
    end  
end 
addCommandHandler ("playsound", sounFunction) 
addCommandHandler ("stopsound", sounFunction) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...