Jump to content

What event i must trigger for to play sound?


proracer

Recommended Posts

Hey guys.I started to make DM map but DM with cars not guns, Race type but DM.I wanted to put song into the map and i think i must use: "playSound" function right? If is that correct i don't know what event i must trigger to play this because i searched events connected for when map starts or something but i found nothing.So my question is: Is is possible to play song and what event i must trigger to start it.. and it should be client event right? Sorry if im really annoying im not that pro in scripting but im good in mapping :P Plz help me if you can ;)

Link to comment
function resource_starts_0 ()
end
addEventHandler ( "onClientResourceStart", getRootElement(), resource_starts_0 )
 
function resource_starts_1 ()
playSound ( "Brian Nrg - Suck My Ballz.mp3" )
end

Is this ok? And yeah i copied from someone <.<

Link to comment

your function contains no instructions (the resource_starts_0 one). this will work:

function resource_starts_0 ()
playSound ( "Brian Nrg - Suck My Ballz.mp3" )
end
addEventHandler ( "onClientResourceStart", getRootElement(), resource_starts_0 )

if you don't want the sound to be played whenever any resource starts do this:

function resource_starts_0 ()
playSound ( "Brian Nrg - Suck My Ballz.mp3" )
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), resource_starts_0 )

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