Jump to content

Song from map, loading and etc..


papam77

Recommended Posts

Hello, i have one code but i wanna block loading from map music from map and etc... in my script. How can do it ?

------------------------------------------------- 
-- Components 
------------------------------------------------- 
showCursor ( true ) 
showChat ( true ) 
showPlayerHudComponent ( source, "ammo", false ) 
showPlayerHudComponent ( source, "weapon", false )  
  
  
------------------------------------------------- 
-- Background and Images 
------------------------------------------------- 
addEventHandler("onClientResourceStart", resourceRoot, 
    function()     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
    dxDrawImage(0, 0, 1920, 1080, "img/lobby-bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    dxDrawText("Choose an arena", 514, 0, 1720, 189, tocolor(255, 255, 255, 255), 3.00, "bankgothic", "left", "top", false, false, true, false, false) 
     
    end 
) 

Because i hear song from map and see map changing icon.

Link to comment

You mean to stop the music from the maps? If so:

addEventHandler('onClientResourceStart', getRootElement(), 
function(that) 
    if that ~= this then 
        for i, v in ipairs(getElementsByType("sound", that)) do 
            stopSound(v) 
        end 
    end 
end ) 

-- Experimenting with the second argument of getElementsByType, if it doesn't work, just change it to getElementsByType("sound").

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