Forum

> > CS2D > General > utsfx sample mod help.
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch utsfx sample mod help.

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt utsfx sample mod help.

Marijuana
User Off Offline

Zitieren
When I kill a couple people in my server, the sounds work fine, but after a few seconds it resets back to 0, and I have to go through the whole process again (example: double kill, etc).

So I changed the "3" seconds shown in
1
2
3
4
5
6
7
8
9
addhook("kill","sample.ut.kill")
function sample.ut.kill(killer,victim,weapon)
	if (os.clock()-sample.ut.timer[killer])>3 then
		sample.ut.level[killer]=0;
	end
	level=sample.ut.level[killer]
	level=level+1
	sample.ut.level[killer]=level
	sample.ut.timer[killer]=os.clock()

to a 60, in other words, 1 minute.
1
2
3
4
5
6
7
8
9
addhook("kill","sample.ut.kill")
function sample.ut.kill(killer,victim,weapon)
	if (os.clock()-sample.ut.timer[killer])>60 then
		sample.ut.level[killer]=0;
	end
	level=sample.ut.level[killer]
	level=level+1
	sample.ut.level[killer]=level
	sample.ut.timer[killer]=os.clock()

But when I exceed the last utsfx step by getting the set amount of kills (which is 42):
1
2
3
elseif (level==42) then
			   parse("sv_sound toxic/massacre.wav")
			   msg("©255255255"..player(killer,"name").." had caused a Massacre!");

and then I die, I don't get double kill or anything after that, unless I don't kill anything for 60 seconds.

What part of this script allows the utsfx to reset when I die?


If you would like to see the entire script (which is pretty big) please don't hesitate to ask.

alt Re: utsfx sample mod help.

DC
Admin On Online

Zitieren
using the lua scripting thread would have been a better idea probably. however:

add the following line to the end of the kill function:
1
sample.ut.level[victim]=0
I think it should do the job. it will simply reset your level to 0 when you die.

it's rather obvious.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht