Jump to content

A Help PLS For a [DM]map script


George.exe

Recommended Posts

Hey All!Im Making Map On MTA Map Editor.I Have Finished My Map And I Want To Put Music Script On My Map But I Dont Know How!Please Teach Me :D

This should be in the scripting section. Anyway... :roll:

Go to the map you created (x:\Program files\MTASA\server\mods\deathmatch\resources\) and make a .lua file.

The lua should contain these lines:

function onResourceStart() 
    local sound = playSound("YOURSONG'SNAMEHERE.mp3")  
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) 

Then go to the map's Meta.xml and write:

     <script src="script_c.lua" type="client"/> 
     <file src="YOURSONG'SNAMEHERE.mp3" /> 

Paste those lines above .

Hope it helps.

Link to comment
  • 4 weeks later...

You can also use this script, it has also that option to stop the music on M button :

setRadioChannel(0) 
song = playSound("song.mp3", true) 
  
bindKey("m", "down", 
function () 
        setSoundPaused(song, not isSoundPaused(song)) 
end 
) 

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