GreenBill Posted May 23, 2015 Posted May 23, 2015 I hope I win it all!I did not know how to add a map link attached to the music so I want you to agree what would you do! Music: https://www.youtube.com/watch?v=tTaxn9KWz-4 Have a nice day!4 random-color.rar Quote
MegasXLR Posted May 23, 2015 Posted May 23, 2015 Hi Green From what I understand you don't know how to add that (awesome) song into your map, right? If that's the case, take a look at my thread for help with mapping GreenBill 1 Quote
MegasXLR Posted May 23, 2015 Posted May 23, 2015 (edited) Here you go :1st - go to this link and read a bit 2nd - I noticed that the link by BinSlayer is broken so --> copy the below into Notepad++ and save it as a .lua file called music (so final file should be "music.lua") function startMusic() setRadioChannel(0) song = playSound("files/music.mp3",true)outputChatBox("", 255, 0, 0, true)outputChatBox("<------------------------------------->", 255, 0, 0, true)outputChatBox("Knight Rider Theme (2008)", 255, 255, 0, true)outputChatBox("Toggle music on/off using M", 0, 255, 128, true)outputChatBox("<------------------------------------->", 255, 0, 0, true)outputChatBox("", 255, 0, 0, true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent()end function toggleSong() if not songOff then setSoundVolume(song,0)songOff = trueremoveEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)else setSoundVolume(song,1)songOff = falsesetRadioChannel(0)addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)endend addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic)addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff)addCommandHandler("mkmap1_racetheme",toggleSong)bindKey("m","down","mkmap1_racetheme")3rd - Download the song from zippyshare or with youtube downloader and put it in a new folder inside your map's main folder called "files". Name the song "music.mp3"4th - Open your "meta.xml" file again with Notepad++ and copy paste the following lines anywhere under <meta> and above <settings> <file src="files/music.mp3" /><script src="music.lua" type="client" />Now save your meta.xml file and go see if music works. OPTIONAL : You may have noticed the "outputChatBox" lines in the music.lua I posted above. Those are just lines which show up in chat when your map starts. So in my case it showed one blank line, one with arrows after that, one with song name after that one, then the line which says with which key you stop music and finally another blank line.And the 3 numbers are color codes for the text on each line.All this is OPTIONAL. If you don't want to add song name or anything else, you can delete all lines. I'd advise you to keep the line which says with which button you can stop music as it makes it easier for players to turn off song if they don't like it [it's awesome btw ]So that's about it. Try it and let me know if you need any more help with your map. D: HERE'S A VIDEO Edited May 23, 2015 by MegasXLR Quote
Cena Posted June 4, 2015 Posted June 4, 2015 (edited) Here, this will help you: Try to add it and if you had mistakes im gonna fix it for you. Edited June 4, 2015 by Cena MegasXLR 1 Quote
MegasXLR Posted June 4, 2015 Posted June 4, 2015 (edited) I fixed his map yesterday Cena (the music part, I mean) Edited June 4, 2015 by MegasXLR Quote
MegasXLR Posted June 4, 2015 Posted June 4, 2015 (Nts) mapWhat do you mean by this? Your map isn't NTS, it's normal [RACE] map. He didn't post it yet then, right?Guess so. Quote
Cena Posted June 5, 2015 Posted June 5, 2015 If its a NTS map you need to add [NTS]<mapname>.Your meta is wrong. You need to edit the meta and write racemode="nts" beside gamemode="race". Its should look like this: gamemodes="race" racemode="nts"Read: http://mrgreengaming.com/forums/topic/14734-mapping-rules-for-mta/ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.