Forum

> > CS2D > Scripts > [Q]freeimage()
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Q]freeimage()

4 replies
To the start Previous 1 Next To the start

old [Q]freeimage()

Iamle0
User Off Offline

Quote
Hey.:) Can you tell me? Why when i move from "property"==11 (snow) to the normal floor (any other) freeimage(id) wont work, but when i move from snow to metal("property"==15) it works perfect.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("movetile","speed")

function speed(id,x,y)
freeimage(id)
        if (tile(x,y, "property")==15) then
		parse("speedmod "..id.." 20")
        elseif (tile(x,y, "property")==11) then
		parse("speedmod "..id.." 0")
		id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
		imagecolor(id1,0,0,0)
		imagealpha(id1,0.9)
		imagescale(id1,640,480)
	else
		parse("speedmod "..id.." 0")
	end
end

old Re: [Q]freeimage()

Zins
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("movetile","speed")

 function speed(id,x,y)
 freeimage(id)
 if (tile(x,y, "property"==11) then
           parse("speedmod "..id.." 20")
 elseif (tile(x,y, "property"==11) then
           parse("speedmod "..id.." 0")
           id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
           imagecolor(id1,0,0,0)
           imagealpha(id1,0.9)
           imagescale(id1,640,480)
      else
           parse("speedmod "..id.." 0")
      end
 end
try this maby it work's
edited 1×, last 03.02.12 08:10:32 pm

old Re: [Q]freeimage()

MikuAuahDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("movetile","speed")
function speed(id,x,y)
        if tile(x,y,"property")==15 then
		parse("speedmod "..id.." 20")
        elseif tile(x,y, "property"==11) then
		parse("speedmod "..id.." 0")
		id1=image("gfx/sprites/block.bmp",1,1,132+id,id)
		imagecolor(id1,0,0,0)
		imagealpha(id1,0.9)
		imagescale(id1,640,480)
	else
		parse("speedmod "..id.." 0")
	end
	freeimage(id1)
end
untested!

old Re: [Q]freeimage()

MikuAuahDark
User Off Offline

Quote
im tired now. im busy. so later!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fimage=true
addhook("movetile","speed")
function speed(id,x,y)
	if tile(x,y,"property")==15 then
		parse("speedmod "..id.." 20")
		if fimage==false then
			freeimage(id+1)
			fimage=true
		end
	elseif tile(x,y, "property"==11) then
		parse("speedmod "..id.." 0")
		id+1=image("gfx/sprites/block.bmp",1,1,132+id,id)
		imagecolor(id1,0,0,0)
		imagealpha(id1,0.9)
		imagescale(id1,640,480)
		fimage=false
	else
		parse("speedmod "..id.." 0")
		if fimage==false then
			freeimage(id+1)
			fimage=true
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview