Jump to content

Play sound files at a specific time?


Recommended Posts

Hi there,

Now i startet working with the Lua Tutorials and i got one question:

Is it possible to play a sound file at a specific time?

E.g.:

There is this Headshot ressource:

addEvent "onPlayerHeadshot" 
  
addEventHandler("onPlayerDamage", getRootElement(), 
    function (attacker, weapon, bodypart, loss) 
        if bodypart == 9 then 
            local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) 
            if result == true then 
                killPlayer(source, attacker, weapon, bodypart) 
            end 
        end 
    end 
) 

Now i got the Headshot sound from CS, is it possible to play the file when the Player IS killed by headshot?. Atm i didnt find a lua command to play music files :?:

And one more:

When one team wins the round (or Tie), would it be possible to play several soundfiles to each team?

E.g.:

Team read wins, now "Missioncomplete.mp3" should be played but only for red team. FOr Blue Team the file "yoursquadhasbeeneleminated.mp3" should be played. Is this possible?

In the Wiki i only found something about

playMissionAudio 

and

playSoundFrontEnd 

. Maybe it is possible to specify an

int 

from playMissionAudio as sound file?

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