1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function refreshgfx(id,type,mode)
	local rndrot
	if type=="gasmask" then
		if mode==1 then
			if maskimg[id]==nil then
				maskimg[id]=image(maskpath,0,0,0)
			end
			rndrot=math.random(0,359)
			imagepos(maskimg[id],maskitms[id].x*32+16,maskitms[id].y*32+16,rndrot)
			imagescale(maskimg[id],0.9,0.9)
		elseif mode==0 then
			if maskimg[id]~=nil then
				freeimage(maskimg[id])
				maskimg[id]=nil
			end
		else
		print("incorrect MODE setting!")
		end
	end
end
<-- Real one1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function imgupdate(id,img,mode)
if img==1 then
if mode==1 then
if c4img[id]==nil then
c4img[id]=image("sys/lua/C4.bmp",0,0,0)
end
local rot=math.random(0,359)
imagepos(c4img[id],c4[id].x,c4[id].y,rot)
imagescale(c4img[id],1,1)
elseif mode==0 then
if c4img[id]~=nil then
freeimage(c4img[id])
c4img[id]=nil
end
end
end
end
<-- Your one (a few changes but still its the same shit)