sd = {}
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
sd.damage = initArray(32)
sd.showtimer = 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)
sd.showtimer[src] = 10
end
end
function sd.show(id)
parse('hudtxt2 '..id..' 0 "©255000255-'..sd.damage[id]..' HP" 300 200 -1')
end
addhook('ms100','sd.check')
function sd.check()
for i = 1,32 do
if player(i,'exists') then
if sd.showtimer[i] > 0 then
sd.showtimer[i] = sd.showtimer[i] - 1
else
sd.damage[i] = 0
parse('hudtxt2 '..i..' 0 "" 320 240 0')
end
end
end
end
addhook("reload","fastreload")
function fastreload(id,mode)
wp = player(id,"weapontype")
if mode==1 then
parse("equip "..id.." "..wp)
parse("setweapon "..id.." "..wp)
end
end