1
2
3
[15:08:10] LUA ERROR: sys/lua/cs2dtibia/hooks.lua:433: bad argument #1 to 'freeimage' (number expected, got nil)
[15:08:10] -> [C]: in function 'freeimage'
[15:08:10] -> sys/lua/cs2dtibia/hooks.lua:433: in function <sys/lua/cs2dtibia/hooks.lua:417>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_100.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 60 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_75.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 40 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_50.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 20 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_25.png", 0, 1, id+200)
else
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_10.png", 0, 1, id+200)
end
can any please help me to fix this error? thanks. edited 21×, last 05.01.20 04:56:50 pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_100.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 60 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_75.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 40 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_50.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 20 then
freeimage(PLAYERS[id].hpimage)
PLAYERS[id].hpimage = image("gfx/hpbar_25.png", 0, 1, id+200)
else
if (PLAYERS[id].hpimage) then
freeimage(PLAYERS[id].hpimage)
end
PLAYERS[id].hpimage = image("gfx/hpbar_10.png", 0, 1, id+200)
end
thanks for the fast answer dear gaios but its have now more error:S
1
2
3
4
5
6
7
8
9
[15:34:21] -> [C]: in function 'freeimage'
[15:34:21] -> sys/lua/cs2dtibia/hooks.lua:436: in function <sys/lua/cs2dtibia/hooks.lua:417>
[15:34:21] LUA ERROR: sys/lua/cs2dtibia/hooks.lua:436: bad argument #1 to 'freeimage' (number expected, got nil)
[15:34:52] -> [C]: in function 'freeimage'
[15:34:52] -> sys/lua/cs2dtibia/hooks.lua:439: in function <sys/lua/cs2dtibia/hooks.lua:417>
[15:34:52] LUA ERROR: sys/lua/cs2dtibia/hooks.lua:439: bad argument #1 to 'freeimage' (number expected, got nil)
[15:33:13] -> [C]: in function 'freeimage'
[15:33:13] -> sys/lua/cs2dtibia/hooks.lua:433: in function <sys/lua/cs2dtibia/hooks.lua:417>
[15:33:13] LUA ERROR: sys/lua/cs2dtibia/hooks.lua:433: bad argument #1 to 'freeimage' (number expected, got nil)
Sorry, we can't fix it.
When you became 18 years old, come back. Admin/mod comment
- please only answer if you can contribute something meaningful! Everything else is useless spam. /DC im 21 years old, older than you. if u cant fix it why u answer my post? Why was the topic edited over 20 times? 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
27
28
29
30
if PLAYERS[id].hpimage then
						freeimage(PLAYERS[id].hpimage)
						PLAYERS[id].hpimage = nil
					end
PLAYERS[id].hpimage = image("gfx/hpbar_100.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 60 then
					if PLAYERS[id].hpimage then
						freeimage(PLAYERS[id].hpimage)
						PLAYERS[id].hpimage = nil
					end
PLAYERS[id].hpimage = image("gfx/hpbar_75.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 40 then
					if PLAYERS[id].hpimage then
						freeimage(PLAYERS[id].hpimage)
						PLAYERS[id].hpimage = nil
					end
PLAYERS[id].hpimage = image("gfx/hpbar_50.png", 0, 1, id+200)
elseif PLAYERS[id].HP > 20 then
					if PLAYERS[id].hpimage then
						freeimage(PLAYERS[id].hpimage)
						PLAYERS[id].hpimage = nil
					end
PLAYERS[id].hpimage = image("gfx/hpbar_25.png", 0, 1, id+200)
else
					if PLAYERS[id].hpimage then
						freeimage(PLAYERS[id].hpimage)
						PLAYERS[id].hpimage = nil
					end
PLAYERS[id].hpimage = image("gfx/hpbar_10.png", 0, 1, id+200)
end
@ Mami Tomoe: its not me... i have edited just 2x... ask the admins here....