English its about my rpg tibia lua, free image [solved]

7 replies
Goto Page
To the start Previous 1 Next To the start
Up
haha1955
User
Offline Off
Code:
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>



Code:
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
05.01.20 03:26:24 pm
Up
Gaios
Security Supporter
Offline Off
Code:
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
05.01.20 03:40:48 pm
Up
haha1955
User
Offline Off
thanks for the fast answer dear gaios but its have now more error:S

Code:
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)
05.01.20 03:48:37 pm
Up
The kennyS
User
Offline Off
Sorry, we can't fix it.

When you became 18 years old, come back.

Admin/mod comment:

rules §2.1 - Needless and/or doubled posts (spam) are forbidden, no "+1", "inb4" etc. - please only answer if you can contribute something meaningful! Everything else is useless spam. /DC
05.01.20 03:50:32 pm
Up
haha1955
User
Offline Off
im 21 years old, older than you. if u cant fix it why u answer my post?
05.01.20 08:32:35 pm
Up
Goo
User
Offline Off
Why was the topic edited over 20 times?
06.01.20 12:42:23 am
Up
Promaster
User
Offline Off
Code:
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
IMG:https://image.prntscr.com/image/J20O66l1RQGtFLeN9dmW6g.png
Patch 13.1! Updated. 2018-02-14
06.01.20 10:58:20 am
Up
haha1955
User
Offline Off
@user Goo: its not me... i have edited just 2x... ask the admins here....
To the start Previous 1 Next To the start