Jump to content
Mr. Green Gaming

How to use custom vehicle, object's skin & music in MTA


Recommended Posts

  • 1 year later...

http://www.xoti.net/stuff/uploads/music_3bfb.lua

 

When i try to open that link, this pops up.. HELP

 

Not Found

The requested URL /stuff/uploads/music_3bfb.lua was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

You've been searching too much pikachu gifs your browser broke.

Try to get music.lua from any map which has it in MTA San Andreas\mods\deathmatch\resources\

Link to comment
  • 4 weeks later...
  • 2 weeks later...
Guest AleksCore

18 minutes... If you want my opinion - this is TOO long. I don't want to see how you typing in notepad and other shit. Good lesson = short lesson. Remember it, when you will do another one

Link to comment
  • 1 year later...

The music.lua seems to have dissapeared. The lua script below works, I believe I once copied it from these forums too. Save it in a file called music.lua , create a folder called files in your maps' location and put the music file in it called music.mp3

function startMusic()
    setRadioChannel(0)
    song = playSound("files/music.mp3",true)
	outputChatBox("Press M to mute the music.")
end

function makeRadioStayOff()
    setRadioChannel(0)
    cancelEvent()
end

function toggleSong()
    if not songOff then
	    setSoundVolume(song,0)
		songOff = true
		removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	else
	    setSoundVolume(song,1)
		songOff = false
		setRadioChannel(0)
		addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	end
end

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic)
addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff)
addCommandHandler("mkmap1_racetheme",toggleSong)
bindKey("m","down","mkmap1_racetheme")

 

Link to comment
26 minutes ago, Bierbuikje said:

The music.lua seems to have dissapeared. The lua script below works, I believe I once copied it from these forums too. Save it in a file called music.lua , create a folder called files in your maps' location and put the music file in it called music.mp3


function startMusic()
    setRadioChannel(0)
    song = playSound("files/music.mp3",true)
	outputChatBox("Press M to mute the music.")
end

function makeRadioStayOff()
    setRadioChannel(0)
    cancelEvent()
end

function toggleSong()
    if not songOff then
	    setSoundVolume(song,0)
		songOff = true
		removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	else
	    setSoundVolume(song,1)
		songOff = false
		setRadioChannel(0)
		addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	end
end

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic)
addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff)
addCommandHandler("mkmap1_racetheme",toggleSong)
bindKey("m","down","mkmap1_racetheme")

 

Just make sure you got the resource path right... i usually forget that part and fuck it up.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...