Forum

> > CS2D > Scripts > Counting Damage ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Counting Damage ?

6 replies
To the start Previous 1 Next To the start

old Counting Damage ?

Kirito2K
User Off Offline

Quote
Hi us !
I need a simple script that count the damage you did for the other players , and show it in a hud text.

old Re: Counting Damage ?

Talented Doge
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
yuki = {}
addhook("hit", "yuki.hit")

function yuki.hit(vic, src, wpn, dmg1, dmg2, dmg3)
	if src < 33 and src > 0 and player(src, "exists") then
		msg2 (src, "\169255255255-"..dmg1.."HP@C")
		return 1
	end
end

old Re: Counting Damage ?

J192
User Off Offline

Quote
@user Kirito2K: Then maybe you should have said so and explained in the OP. Any normal human being will think that you want a damage indicator with the current contents of the OP.

old Re: Counting Damage ?

Mora
User Off Offline

Quote
tested, worked, baby,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sd = {}

function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

sd.damage = initArray(32)

addhook('hit','sd.hit')
function sd.hit(id,src,wpn,hp)
	if hp > 0 then
		sd.damage[src] = sd.damage[src] + hp
		sd.show(src)
	end
end

function sd.show(id)
parse('hudtxt2 '..id..' 1 "\169255000000Damage Total: \169255195100'..sd.damage[id]..' " 120 338')
end

old Re: Counting Damage ?

Talented Doge
User Off Offline

Quote
That's a stuff like kill streak, instead of kill number it uses damage. Easy stuff.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dmgdealed = {}

addhook("hit", "_h")
addhook("spawn", "_s")

function _h (vic, src, wpn, dmg1, dmg2, dmg3)
	if vic > 0 and vic < 33 and src > 0 and src < 33 then
		dmgdealed[src] = dmgdealed[src] + dmg1
		parse ('hudtxt2 '..src..' 1 "\169255255255Dmg Dealed: '..dmgdealed[src]..' " 577 350 1')
	end
end

function _s (p)
	dmgdealed[p] = 0
	parse ('hudtxt2 '..p..' 1 "\169255255255Dmg Dealed: '..dmgdealed[p]..' " 577 350 1')	
end

May not be perfect though.
edited 1×, last 25.04.15 01:26:34 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview