Forum
CS2D Scripts freeimage on class changefreeimage on class change
4 replies 1
1
2
2
imag_btch = image("gfx/shitclass/shitauta.png",blablabal) freeimage(imag_btch)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
... sarmor = {} -- WARLOCK 	if (sample.classes.class[id]==8) then 		parse ("setmaxhealth "..id.." 135") 		parse ("equip "..id.." 80") 		sarmor[id] = image ("gfx/sprites/Aura.bmp" ,0,0,id+100) 		 imageblend(sarmor[id],1) 		 imagecolor(sarmor[id],255,0,255) 		 tween_rotateconstantly(sarmor[id],1) 		return "86,47" 	end end addhook ("die","sarmor_remove") function sarmor_remove (victim) 	freeimage(sarmor[victim]) end
This way it works, but when a player dies who is different class than this, it still tries to freeimage although he doesn't have it and then I get an error in console. If I put:
if (sample.classes.class[id]==8) then
no error but the image is not removed on class change.
1