Forum

> > CS2D > Scripts > Free image no more working?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Free image no more working?

3 replies
To the start Previous 1 Next To the start

old Free image no more working?

-DIE Wolf-
User Off Offline

Quote
Hey! Let I get some erro about:
1
freeimage(id)
Example LUA like:
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
addhook("say","say_hat")
function say_hat(id,txt)
	if (txt=="!helmet") then
		freeimage(id) 
		id=image("gfx/hats/helmet.bmp",1,1,200+id)
	end
	if (txt=="!spikes") then
		freeimage(id) 
		id=image("gfx/hats/spikes.png",1,1,200+id) 
	end
	if (txt=="!phoenix") then
		freeimage(id) 
		id=image("gfx/hats/phoenix.png",1,1,200+id)
	end
	if (txt=="!corner") then
		freeimage(id) 
		id=image("gfx/hats/wing5.bmp",1,1,200+id)
	end
	if (txt=="!nohat") then
		freeimage(id) 
	end
	if (txt=="!tyrans") then
		freeimage(id) 
		id=image("gfx/hats/tyrans.bmp",1,1,200+id) 
	end
end
When i choose new hat, my old hat not gone!
That mean freeimage(id) not work?
Help me! Im bad English.

old Re: Free image no more working?

-DIE Wolf-
User Off Offline

Quote
user ohaz has written
you're trying to free the image of the player. That's not possible. The IDs are completely wrong

So what do you mean? I thought that work before CS2D update to 0.1.2.2

old Re: Free image no more working?

Avo
User Off Offline

Quote
"id" is function's argument here. I prefer to use tables with images' IDs. Look at this:
Spoiler >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview