Forum

> > CS2D > Scripts > how to make customkill
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch how to make customkill

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt how to make customkill

Eternal
User Off Offline

Zitieren
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

alt Re: how to make customkill

Avo
User Off Offline

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

alt Re: how to make customkill

Avo
User Off Offline

Zitieren
@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 )

alt Re: how to make customkill

mafia_man
User Off Offline

Zitieren
Nope it's possible to customkill with spaces :
1
parse("customkill " .. source .. " '" ..wn.weapon_names[weapon].. "' " .. id)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht