Jump to content

Race - Next Map Starts In:


papam77

Recommended Posts

-- server side:

addEvent ( "onPostFinish", true ) 
addEventHandler ( "onPostFinish", root, 
    function ( ) 
        triggerClientEvent ( root, "playSound", root ) 
    end 
) 

-- client side:

addEvent ( "playSound", true ) 
addEventHandler ( "playSound", root, 
    function ( ) 
        playSound ( "url or path here" ) 
    end 
) 

Not tested, I leave that part to you.

Link to comment

part of meta:


song_c.lua

addEvent ( "playSound", true ) 
addEventHandler ( "playSound", root, 
    function ( ) 
    playSound ( "song.mp3" ) 
    end 
) 

song_s.lua

addEvent ( "onPostFinish", true ) 
addEventHandler ( "onPostFinish", root, 
    function ( ) 
        triggerClientEvent ( root, "playSound", root ) 
    end 
) 

Path:

/s1.hrajminecraft.cz_22003/mods/deathmatch/resources/[eag]/main_eag/endsong

And doesn't work while end.

Link to comment
addEvent ( "playSound", true ) 
addEventHandler ( "playSound", root, 
    function ( ) 
        if ( isElement ( song ) ) then 
            destroyElement ( song ) 
        end 
        song = playSound ( "endsong/song.mp3" ) 
    end 
) 

Link to comment
local g_Root = getRootElement() 
local g_ResRoot = getResourceRootElement(getThisResource()) 
  
local soundVolume = 0.0 
  
  
function vratitHlasitost () 
    for i, sound in ipairs(getElementsByType("sound")) do 
        setSoundVolume(sound, 1) 
    end 
end 
  
addEvent ( "playSound", true ) 
addEventHandler ( "playSound", root, 
    function ( ) 
        if ( isElement ( song ) ) then 
            destroyElement ( song ) 
        end 
        song = playSound ( "endsong/song.mp3" ) 
            setSoundVolume(sound, soundVolume) 
    setTimer(vratitHlasitost, 5000, 1) 
    end 
) 
  
addCommandHandler("soundvolume", 
    function(cmd, value) 
        soundVolume = value/100 
        outputConsole("set sound volume to "..value.."%") 
    end 
) 
  

And doesn't work :x

Link to comment

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...