Jump to content

Music


bartje01

Recommended Posts

Meta.xml is only for makeing resource know which scripts are u using at this folder.

So, make a new file. Lets make it as example mysound.lua

now open mysound.lua and copy paste this to there:

addEventHandler ( "onClientResourceStart",getResourceRootElement(getThisResource()), 
function ( ) 
    playSound ( 'mysong.mp3' ) -- put the song in your map folder 
end 
) 

First, replace 'mysong' to your song name. ( Do not delete .mp3 )

Now open the meta.xml

add those lines to there:

( Replace mysong to your song name )

save files, and restart script, should work. If u maked everything right

Link to comment
@ the kid.

Can you even read?

I told you guys that I've read the wiki but still didn't come out

So when someone tells you THE RIGHT WIKI PAGE, WHERE EVERYTHING is there, you just "insult" and don't try to understand anything?

You didn't read the wiki, you just SAW it. You should try to understand before asking for help...

Whatever, CowTurbo gave you the code so I can't give you the lesson I've wanted to.

Link to comment

@ Thekid

Well I didn't really insult you. I asked if you can read. Not said that you can't read. I just think it's to easy to say to just send me the wiki link. It's just so you can get a post in my eyes

I know the wiki link btw. Otherwise I couldn't have read it already. And yes, I did read it. I just didn't find it.

@Solidsnake.

Thanks.

But why get lost? : o

Link to comment

To say "can you even read?" is an INDIRECT insult. Don't try to lie.

You wanted to say I'm a stupid guy that doesn't help. I don't care, anyway. You are the one that won't learn anything...

And if you readed the wiki page I gave you, and didn't find the solution, means you did read but without paying attention to...

Link to comment
  • Moderators

Hi,

You can replay it like this:

function playMySong( thePlayer, commandName ) 
    playSound ( 'mysong.mp3' , true) 
end 
addCommandHandler( "play", playMySong, false, false ) 
addEventHandler ( "onClientResourceStart",getResourceRootElement(getThisResource()), playMySong ) 

Here the song is played when the resource is started, and when a player make the command /play

You can also play the song in other functions like this:

playMySong() 

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