• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Event Error in fuction.

psilocibe

Member
Joined
Jul 9, 2007
Messages
480
Reaction score
9
function 'getguildname'
function 'GuildName'

Any change in these functions tfs 0.4 to 1.0?

I can not fix error.

---- Follows Function

Woe.getGuildName function (id)
Local db.getResult res = ("SELECT` name `FROM` guilds `WHERE` id `=" .. id .. ";")
if (res: getID () ~ = -1) then
ret = res: getDataString ('name')
re: free ()
end
return ret
end

---- Follow the error.

. / _woe.lua: 76: attempt to call field 'getResult' (a nil value)
stack traceback:
[C]: in function 'getResult'
. / _woe.lua: 76: in function 'getguildname'
. / _woe.lua: 91: in function 'GuildName'
date / talkactions / scripts / woe.lua: 23: in function <data/talkactions/scripts/woe.lua:5>

Does anyone have any idea on how to fix this?

Tkz ninja this fix,

http://pastebin.com/NESKT1Gb

Now new error in other function.

---- Follow error
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/woe.lua:onSay
./_woe.lua:88: attempt to call global 'getPlayerNameByGUID' (a nil value)
stack traceback:
[C]: in function 'getPlayerNameByGUID'
./_woe.lua:88: in function 'breakerName'
data/talkactions/scripts/woe.lua:23: in function <data/talkactions/scripts/woe.lua:5>

---- Follow Function
function Woe.breakerName()
Woe.getInfo()
return infoLua[3] ~= 0 and getPlayerNameByGUID(infoLua[3]) or 'None'
end
 
Last edited by a moderator:
Now new error in other function.

---- Follow error
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/woe.lua:eek:nSay
./_woe.lua:88: attempt to call global 'getPlayerNameByGUID' (a nil value)
stack traceback:
[C]: in function 'getPlayerNameByGUID'
./_woe.lua:88: in function 'breakerName'
data/talkactions/scripts/woe.lua:23: in function <data/talkactions/scripts/woe.lua:5>

---- Follow Function
function Woe.breakerName()
Woe.getInfo()
return infoLua[3] ~= 0 and getPlayerNameByGUID(infoLua[3]) or 'None'
end

Code:
function getPlayerNameByGUID(guid)
     local resultx = db.storeQuery("SELECT `name` FROM `players` WHERE `id` = " .. guid)
     if resultx then
         name = result.getDataString(resultx, 'name')
         result.free(resultx)
         return name
     end
     return LUA_ERROR
end
 
Back
Top