Forum

> > CS2D > Scripts > Strip nv or defuse kit.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Strip nv or defuse kit.

3 replies
To the start Previous 1 Next To the start

old Strip nv or defuse kit.

Powermonger
User Off Offline

Quote
Hello again scripters,

I couldn't find any threads about stripping night vision goggles or defuse kit.

Can someone who knows, tell me how to do those commands.
Parsing strip won't work, I have already tested that.

Thanks.

old Re: Strip nv or defuse kit.

Cure Pikachu
User Off Offline

Quote
Here, use this. I haven't tested it out yet, but the idea should be there. Gas masks cannot be stripped normally, so I added that too.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function strip(id,item)
	if player(id,"exists") and player(id,"health") > 0 then -- Cheap precautions
		local armor, hp, mhp, wpnlist, x, y
		armor = player(id,"armor")
		hp = player(id,"health")
		mhp = player(id,"maxhealth")
		wpnlist = playerweapons(id)
		x = player(id,"x")
		y = player(id,"y")
		local df = false
		local nv = false
		local gm = false
		if player(id,"defusekit") then df = true end
		if player(id,"nightvision") then nv = true end
		if player(id,"gasmask") then gm = true end
		if item == 56 or item == 59 or item == 60 then
			parse("spawnplayer "..id.." "..x.." "..y)
			parse("setmaxhealth "..id.." "..mhp)
			parse("sethealth "..id.." "..hp)
			parse("setarmor "..id.." "..armor)
			for _, w in ipairs(wpnlist) do
				parse("equip "..id.." "..w)
			end
			if item == 56 then
				if nv == true then parse("equip "..id.." 59") end
				if gm == true then parse("equip "..id.." 60") end
			elseif item == 59 then
				if df == true then parse("equip "..id.." 56") end
				if gm == true then parse("equip "..id.." 60") end
			elseif item == 60 then
				if df == true then parse("equip "..id.." 56") end
				if nv == true then parse("equip "..id.." 59") end
			end
		else
			parse("strip "..id.." "..item)
		end
	end
end
edited 2×, last 27.11.12 02:32:33 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview