i have a problem with it, it sometimes disappear from itself for no reason how can i fix it? or if theres any better image hud... ty
Forum
CS2D Scripts localhudlocalhud
20 repliesi have a problem with it, it sometimes disappear from itself for no reason how can i fix it? or if theres any better image hud... ty
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
var1 = image() -- var1=1001 var2 = image() -- var2=1002 freeimage(var1) -- no var1=nil and it still store 1001 var3 = image() -- var3=1001 because it's free -- and now at eg. if player leave (hook): if var1 then 	freeimage(var1) 	-- so, it removed image with id from var3 (1001) end
edited 1×, last 20.07.15 10:05:34 pm
But thanks for the tip, will try it out
BTW, DC still should fix this. I'm (We're ?) tired of always having to find workarrounds to get things working properly.
1
2
3
4
5
2
3
4
5
_freeimage = freeimage function freeimage(imgeid) 	_freeimage(imageid) 	-- such code with _G table :) end
EDIT:
You needn't to say that .
edited 1×, last 21.07.15 07:12:56 pm
Anyways, here's my fix (haven't been deep tested yet)
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ifix = { 	image = image, 	freeimage = freeimage, 	data = {} } function image(path, ...) 	ifix.data[path] = ifix.data[path] or {} 	table.insert(ifix.data[path], false) 	ifix.data[path][#ifix.data[path]] = ifix.image(path, ...) 	return ifix.data[path][#ifix.data[path]] end function freeimage(object, ...) 	for path, data in pairs(ifix.data) do 		for key, core in ipairs(data) do 			if core == object then 				ifix.freeimage(core) 				table.remove(ifix.data[path], key) 				return 			end 		end 	end 	print("\169255000000Image["..object.."] not found!") end
EDIT: Fixed a bug
EDIT2: Easier error handling
edited 3×, last 24.07.15 11:52:26 am
dofile('sys/lua/newImageSystem.lua')
Mami Tomoe has written
image location
not lua
and what meme...
Mami Tomoe has written
local hud_img = image("gfx/7hud/full.png", 554, 300, 2)
Like this! but you have to do the things that I said.
Could you guys test it please ?
i tried this code but i dont know where to add this: "gfx/7hud/full.png"
1
ifix.image("gfx/7hud/full.png", ...)