Forum

> > CS2D > General > utsfx sample mod help.
Forums overviewCS2D overviewGeneral overviewLog in to reply

English utsfx sample mod help.

2 replies
To the start Previous 1 Next To the start

old utsfx sample mod help.

Marijuana
User Off Offline

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

old Re: utsfx sample mod help.

DC
Admin Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview