Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 07:04:55 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Win / Lost Sounds
Pages: [1]
Author Topic: Win / Lost Sounds  (Read 3338 times)
christopher92
Poster

Posts: 4


« on: October 24, 2010, 01:25:00 PM »

Hey, i am currently looking to code two sounds into my ttt script but i want to do it so if the terrorist win it plays "your_team_won" to terrorist only and "your_team_lost" to the Traitors and so on

i just want to know what files i need to edit and the codes to put in
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #1 on: October 24, 2010, 03:39:14 PM »

--- optional sound cues on round start and end
CreateConVar("ttt_cl_soundcues", "0")

local cues = {
  Sound("ttt/thump01e.mp3"),
  Sound("ttt/thump02e.mp3")
};
local function PlaySoundCue()
  if GetConVar("ttt_cl_soundcues"):GetBool() then
      surface.PlaySound(table.Random(cues))
  end
end

GM.TTTBeginRound = PlaySoundCue
GM.TTTEndRound = PlaySoundCue


Snipped from gamemodes/terrortown/gamemode/cl_init.lua

I'd assume one would play for win, and the other for loose. You could edit that i suppose to include ply:IsActiveTraitor() which would check if they are a traitor, and play a seperate sound?

Correct me if i'm wrong guys.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
christopher92
Poster

Posts: 4


« Reply #2 on: October 24, 2010, 05:36:46 PM »

Okay, thanks i will test it in a bit
christopher92
Poster

Posts: 4


« Reply #3 on: October 24, 2010, 08:32:15 PM »

do you know if i can use .wav files instead of .mp3?
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #4 on: October 25, 2010, 12:26:49 PM »

You can.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Win / Lost Sounds « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.008 seconds with 17 queries.