Forum

> > CS2D > Scripts > Armor Request
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Armor Request

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Armor Request

RealDespress28
BANNED Off Offline

Zitieren
Hi CS2D Players, i need a script that when you Equip light armor there's an image that it is like an armor with a new design and then when you get hit the player won't kill... need help! if it is hard... tell me.

alt Re: Armor Request

EP
User Off Offline

Zitieren
why don't you change the light armor skin and check if the player has it equipped so they can't get hit?

alt Re: Armor Request

Alistaire
User Off Offline

Zitieren
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
39
40
function array(x)
	local a = {}
	for i = 1, 32 do
		a[i] = x
	end
	return a
end

plr = {}
plr.image = array(0)

armourPath = 'gfx/shadow.bmp'

addhook('collect', 'collectHook')
addhook('hit', 'hitHook')
addhook('leave', 'leaveHook')

function collectHook(id, iid, type)
	if type >= 79 and type <= 84 then
		if plr.image[id] == 1 then
			freeimage(plr.image[id])
		end
		if type == 79 then
			plr.image[id] = image(armourPath, 1, 0, 200 + id)
			plr.image[id] = 1
		else
			plr.image[id] = 0
		end
	end
end

function hitHook(id)
	if player(id, 'armor') == 201 then
		return 1
	end
end

function leaveHook(id)
	plr.image[id] = 0
end

alt Re: Armor Request

Alistaire
User Off Offline

Zitieren
user EP hat geschrieben
@user Alistaire: i think you should freeimage(plr.image[id]) in the function leaveHook...


Images are always freed on leaving. And dieing.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht