Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
Armor Request
6 Antworten![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)
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
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
![user](img/i_friend.png)
![user](img/i_friend.png)
@
Alistaire: i think you should freeimage(plr.image[id]) in the function leaveHook...
![user](img/i_friend.png)
Images are always freed on leaving. And dieing.
![user](img/i_friend.png)
![user](img/i_friend.png)
![user](img/i_friend.png)
Well that was the most bloody amazing description of any error ever.
![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)