Forum

> > CS2D > Scripts > how to make customkill
Forums overviewCS2D overview Scripts overviewLog in to reply

English how to make customkill

6 replies
To the start Previous 1 Next To the start

old how to make customkill

Eternal
User Off Offline

Quote
Hello , i want make new customkill like this , can someone help me ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
wn={}

wn.weapon_names={
	[10]="Pump-Action Shotgun",
	[11]="Auto Shotgun",
}

addhook("hit","wn.hit")
function wn.hit(id,source,weapon,hpdmg,apdmg)
		if player(id,"health")-hpdmg<=0 then
			if wn.weapon_names[weapon]~=nil then
				parse("customkill "..source.." \""..wn.weapon_names[weapon].."\" "..id)
				return 1
			end
		end
		end
pls help me

old Re: how to make customkill

Avo
User Off Offline

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

wn.weapon_names={
     				["10"]="Pump-Action-Shotgun",
     				["11"]="Auto-Shotgun"
			}

addhook("hit","wn.hit")
function wn.hit(id,source,weapon,hpdmg,apdmg)
	if player(id,"health")-hpdmg<=0 then
		if wn.weapon_names[tostring(weapon)]~=nil then
			parse("customkill "..source.." "..wn.weapon_names[tostring(weapon)].." "..id.."")
			return 1
		end
	end
end

It only work if name of weapon doesn't content spaces " ". Use "-" or "_".
For example:
Auto-Shotgun,AutoShotgun
L86-LSW,L86LSW
etc,etc,etc...

old Re: how to make customkill

Eternal
User Off Offline

Quote
thank you man

EDIT :
Arr... I want customkill without content those symbols
can you give an example to me?

old Re: how to make customkill

Avo
User Off Offline

Quote
@user Eternal:

> Don't forget about qutoes marks ------------>["32"] !
> Now I don't have any idea for another solution. Do it this way:
1
2
3
4
5
6
wn.weapons_names={
["32"]="M4",
["45"]="LaserBlaster",
["1"]="USPTactical"

}
(without spaces and other symbols )

old Re: how to make customkill

mafia_man
User Off Offline

Quote
Nope it's possible to customkill with spaces :
1
parse("customkill " .. source .. " '" ..wn.weapon_names[weapon].. "' " .. id)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview