papam77 Posted April 28, 2013 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.
Turky1 Posted April 28, 2013 Posted April 28, 2013 Do you mean to turn the music on and off? I don't understand...
papam77 Posted April 28, 2013 Author 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
codeluaeveryday Posted April 28, 2013 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").
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