I've been searching on forums for freeimage related threads.
These were my examples :
From these forums I came to conclude that this was the solution
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
local hat_images = {} 	-- SOLDIER 	if (sample.classes.class[id]==1) then 		if (hat_images[pl]) then 		freeimage(pl) 		hat_images[pl]=nil 		hat_images[pl]=image("gfx/sprites/flare2.bmp",1,1,100+id) 		parse ("setmaxhealth "..id.." 140") 		parse ("speedmod "..id.." 0") 		parse ("strip "..id.." 50") 		parse ("setmoney "..id.." 16000") 		return "3,69"; --Deagle, Machete 	end 	end
I've also wanted to addhook on die but that still didn't fix the issue.
TL;DR - Images keep on spawning on top of another when I change class.