papam77 Posted April 28, 2013 Share Posted April 28, 2013 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
Turky1 Posted April 28, 2013 Share Posted April 28, 2013 Do you mean to turn the music on and off? I don't understand... Link to comment
papam77 Posted April 28, 2013 Author Share Posted April 28, 2013 Do you mean to turn the music on and off? I don't understand... http://www.img.tpx.cz/uploads/hasugbsofdfp.png Link to comment
codeluaeveryday Posted April 28, 2013 Share Posted April 28, 2013 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
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