AMXX-like RoundSound
5 replies



21.04.11 04:14:24 pm
first of all note that code is so complicated because i want to make separate sounds list for T win and CT win
and next cs2d logfile:
what's wrong here?
and next cs2d logfile:
what's wrong here?
I believe that all you are trying to achieve can be made using simple endround hook which is far from documented (I'm talking about 'mode' argument). Here I did some investigation:
Hope it helps.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
addhook("endround", "end_of_round")
function ctwin()
a = math.random(1,8)
parse(string.format("sv_sound \"misc/rs/ctwin%d.wav\"", a))
end
function twin()
a = math.random(1,8)
parse(string.format("sv_sound \"misc/rs/twin%d.wav\"", a))
end
function end_of_round(mode)
if mode==1 then --Regular T win
twin()
elseif mode==2 then --Regular CT win
ctwin()
elseif mode==3 then --Round draw
elseif mode==4 then --Game commencing
elseif mode==10 then --VIP assassinated; T win
twin()
elseif mode==11 then --VIP escaped; CT win
ctwin()
elseif mode==12 then --VIP did not escape; T win
twin()
elseif mode==20 then --Bomb exploded; T win
twin()
elseif mode==21 then --Bomb defused; CT win
ctwin()
elseif mode==22 then --Failed to plant the bomb in specified time; CT win
ctwin()
elseif mode==30 then --Failed to rescue hostages in specified time; T win
twin()
elseif mode==31 then --All hostages rescued; CT win
ctwin()
elseif mode==40 then --Blue flag captured; T win
twin()
elseif mode==41 then --Red flag captured; CT win
ctwin()
elseif mode==50 then --All points dominated; T win
twin()
elseif mode==51 then --All points dominated; CT win
ctwin()
elseif mode==60 then --All humans infested; Zombies win
elseif mode==61 then --Humans survived; Humans win
end
end
function ctwin()
a = math.random(1,8)
parse(string.format("sv_sound \"misc/rs/ctwin%d.wav\"", a))
end
function twin()
a = math.random(1,8)
parse(string.format("sv_sound \"misc/rs/twin%d.wav\"", a))
end
function end_of_round(mode)
if mode==1 then --Regular T win
twin()
elseif mode==2 then --Regular CT win
ctwin()
elseif mode==3 then --Round draw
elseif mode==4 then --Game commencing
elseif mode==10 then --VIP assassinated; T win
twin()
elseif mode==11 then --VIP escaped; CT win
ctwin()
elseif mode==12 then --VIP did not escape; T win
twin()
elseif mode==20 then --Bomb exploded; T win
twin()
elseif mode==21 then --Bomb defused; CT win
ctwin()
elseif mode==22 then --Failed to plant the bomb in specified time; CT win
ctwin()
elseif mode==30 then --Failed to rescue hostages in specified time; T win
twin()
elseif mode==31 then --All hostages rescued; CT win
ctwin()
elseif mode==40 then --Blue flag captured; T win
twin()
elseif mode==41 then --Red flag captured; CT win
ctwin()
elseif mode==50 then --All points dominated; T win
twin()
elseif mode==51 then --All points dominated; CT win
ctwin()
elseif mode==60 then --All humans infested; Zombies win
elseif mode==61 then --Humans survived; Humans win
end
end
Hope it helps.
gUtZ, may I ask why do you write if statements for events when nothing happens? You'd save space by not writing them.
Also, on a side note, though the code is absolutely correct, you could change
to
The same goes with ctwin files. In my opinion, it would look better aesthetically.
Also, on a side note, though the code is absolutely correct, you could change
Code:
1
2
2
a = math.random(1,8)
parse(string.format("sv_sound \"misc/rs/twin%d.wav\"", a))
parse(string.format("sv_sound \"misc/rs/twin%d.wav\"", a))
to
Code:
1
2
2
a=math.random(1,8)
parse("sv_sound \"misc/rs/twin"..a.."\"")
parse("sv_sound \"misc/rs/twin"..a.."\"")
The same goes with ctwin files. In my opinion, it would look better aesthetically.
I code, therefore I exist.

gUtZ, may I ask why do you write if statements for events when nothing happens? You'd save space by not writing them.
You're right, but this is just an example showing all(?) possible modes.
10.08.11 06:17:06 pm
One problem with this thing: If the terrorists win is simply not willing to play the music you put a good mapa! It is in WAV format!
What is wrong?
Sorry for the bad English speech but I do not know English well!
What is wrong?
Sorry for the bad English speech but I do not know English well!
Have fun !




