Forum

> > CS2D > Scripts > One and only
Forums overviewCS2D overview Scripts overviewLog in to reply

English One and only

6 replies
To the start Previous 1 Next To the start

old One and only

xhehe
User Off Offline

Quote
Hello, I would like to know how to do when the end of a game in which one team has only one player appears a message "One'' Ct X " Number Of Trs"Terrorists and "One" Tr X "Number Of Cts" Counter Terrorists ,and add a sound to play with this message

Sorry for my bad english
edited 1×, last 16.02.13 02:53:50 pm

old Re: One and only

zomb1e
User Off Offline

Quote
I guess he's searching for a script that, given that only one player of each team is left, announces those players names and plays some (epic?) music.

old Re: One and only

xhehe
User Off Offline

Quote
user zomb1e has written
I guess he's searching for a script that, given that only one player of each team is left, announces those players names and plays some (epic?) music.


Exactly, which is why I seek.

old Re: One and only

Alistaire
User Off Offline

Quote
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
addhook('kill', 'AA_kill')
addhook('parse', 'AA_parse')
addhook('leave', 'AA_leave')

function f_announce(id1, id2)
	msg('©200200200Two players left!@C')
	msg('©200200200'..player(id1, 'name')..' and '..player(id2, 'name')..' @C'
end

function f_checkPlayers()
	local a = {player(0, 'team1living'), player(0, 'team2living')}
	if #a[1] == 1 and #a[2] == 1 then
		f_announce(a[1][1], a[2][1])
	end
end

function AA_kill()
	f_checkPlayers()
end

function AA_parse(text)
	if text == 'kill' then
		f_checkPlayers()
	end
end

function AA_leave()
	f_checkPlayers()
end

old Re: One and only

Cure Pikachu
User Off Offline

Quote
I guess that's what you want?
1
2
3
4
5
6
7
8
9
10
addhook("die","announce")
addhook("leave","announce")
function announce()
	local p1 = player(0,"team1living")
	local p2 = player(0,"team2living")
	if #p1 == 1 and #p2 == 1 then
		msg("©192192192Last people standing: ©255025000"..player(p1[1],"name").." and ©050150255"..player(p2[1],"name").."@C")
		parse("sv_sound \"*sound file*\"")
	end
end
Where *sound file* is the directory of the sound file (relative to the sfx folder)!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview