• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Linux Ban System Failed!

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
Hi,

Im using TFS 0.3.7_SVN and I tried to get ban in one player with the command /ban

I have selected > Account > Banishment > Name of player and comment.

The player cant be banned and I receive that message in console:
PHP:
[20:42:14.501] [Error - CreatureScript Interface]
[20:42:14.501] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[20:42:14.501] Description:
[20:42:14.501] data/creaturescripts/scripts/ban/finish.lua:69: attempt to call global 'getAccountWarnings' (a nil value)
[20:42:14.501] stack traceback:
[20:42:14.501]  data/creaturescripts/scripts/ban/finish.lua:69: in function <data/creaturescripts/scripts/ban/finish.lua:10>

Script:
http://pastebin.com/qWGUDPuB

What is wrong?

Bump
 
Last edited:
I would give you a working /ban script if i had my other computer right now, you can always download any datapack or distro to find a new ban command that probably will work
 
line 69 is this
Code:
local warnings, warning = getAccountWarnings(account), 1

There is 1 of 2 possible reasons for this error, either 1 getAccountWarnings does not exist in your distro for whatever reason or 2 account that is being passed to getAccountWarnings is nil and this is why you get this error.

This is the script for your distro, save yours as a backup and use this 1 and see how it goes.
Code:
https://github.com/otservme/global860/blob/748201801a12214e457c73cfe2d62fd4b6583963/data/creaturescripts/scripts/ban/finish.lua
 
line 69 is this
Code:
local warnings, warning = getAccountWarnings(account), 1

There is 1 of 2 possible reasons for this error, either 1 getAccountWarnings does not exist in your distro for whatever reason or 2 account that is being passed to getAccountWarnings is nil and this is why you get this error.

This is the script for your distro, save yours as a backup and use this 1 and see how it goes.
Code:
https://github.com/otservme/global860/blob/748201801a12214e457c73cfe2d62fd4b6583963/data/creaturescripts/scripts/ban/finish.lua

Thanks for try to help me.

So i got that:
PHP:
[11:51:42.938] [Error - CreatureScript Interface]
[11:51:42.938] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[11:51:42.938] Description:
[11:51:42.938] data/creaturescripts/scripts/ban/finish.lua:69: attempt to call global 'getAccountWarnings' (a nil value)
[11:51:42.938] stack traceback:
[11:51:42.938]  data/creaturescripts/scripts/ban/finish.lua:69: in function <data/creaturescripts/scripts/ban/finish.lua:10>
 
Where it says
Code:
local warnings, warning = getAccountWarnings(account), 1

Replace it with this
Code:
print(account)
local warnings, warning = getAccountWarnings(account), 1

Then post the results
 
Where it says
Code:
local warnings, warning = getAccountWarnings(account), 1

Replace it with this
Code:
print(account)
local warnings, warning = getAccountWarnings(account), 1

Then post the results

Hello,

i got that again:
PHP:
[13:45:42.523] [Error - CreatureScript Interface]
[13:45:42.523] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[13:45:42.523] Description:
[13:45:42.523] data/creaturescripts/scripts/ban/finish.lua:70: attempt to call global 'getAccountWarnings' (a nil value)
[13:45:42.523] stack traceback:
[13:45:42.523]  data/creaturescripts/scripts/ban/finish.lua:70: in function <data/creaturescripts/scripts/ban/finish.lua:10>
 
Hello,

i got that again:
PHP:
[13:45:42.523] [Error - CreatureScript Interface]
[13:45:42.523] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[13:45:42.523] Description:
[13:45:42.523] data/creaturescripts/scripts/ban/finish.lua:70: attempt to call global 'getAccountWarnings' (a nil value)
[13:45:42.523] stack traceback:
[13:45:42.523]  data/creaturescripts/scripts/ban/finish.lua:70: in function <data/creaturescripts/scripts/ban/finish.lua:10>
Take a screen shot of the console window.. the entire thing not just the error.
 
Script:
http://pastebin.com/wXxPdf8f

PHP:
[11:45:00.108] [Error - CreatureScript Interface]
[11:45:00.108] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[11:45:00.108] Description:
[11:45:00.108] (luaGetPlayerNameByGUID) Player not found

[11:45:00.108] [Error - CreatureScript Interface]
[11:45:00.108] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[11:45:00.108] Description:
[11:45:00.108] data/creaturescripts/scripts/ban/finish.lua:226: attempt to concatenate a nil value
[11:45:00.108] stack traceback:
[11:45:00.108]  data/creaturescripts/scripts/ban/finish.lua:226: in function <data/creaturescripts/scripts/ban/finish.lua:10>
 
You have to define the variable player beneath L207 ( at least before L225 & 227).
 
Add
Code:
        errors(false)
        local player = getPlayerGUIDByName(data.name, true)
        errors(true)
        if(not player) then
            doPlayerSendCancel(cid, "Player not found.")
            return false
        end
below
Code:
    elseif(data.type == 3) then

Same code as you can find below data.type 1 & 2
dM2pFuw.png
 
Add
Code:
        errors(false)
        local player = getPlayerGUIDByName(data.name, true)
        errors(true)
        if(not player) then
            doPlayerSendCancel(cid, "Player not found.")
            return false
        end
below
Code:
    elseif(data.type == 3) then

Same code as you can find below data.type 1 & 2
dM2pFuw.png

I think that dont work.

So, I used > /ban > Account > Banishment and got that :
PHP:
[17:4:49.763] [Error - CreatureScript Interface]
[17:4:49.763] data/creaturescripts/scripts/ban/action.lua:onChannelRequest
[17:4:49.763] Description:
[17:4:49.763] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)
[17:4:49.763] stack traceback:
[17:4:49.763]   [C]: in function 'ipairs'
[17:4:49.763]   data/lib/050-function.lua:10: in function 'isInArray'
[17:4:49.763]   data/creaturescripts/scripts/ban/action.lua:14: in function <data/creaturescripts/scripts/ban/action.lua:7>

N used /ban > Account > Banishment + Final Warning and got that :
PHP:
[17:5:40.612] [Error - CreatureScript Interface]
[17:5:40.612] data/creaturescripts/scripts/ban/action.lua:onChannelRequest
[17:5:40.612] Description:
[17:5:40.612] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)
[17:5:40.612] stack traceback:
[17:5:40.612]   [C]: in function 'ipairs'
[17:5:40.612]   data/lib/050-function.lua:10: in function 'isInArray'
[17:5:40.612]   data/creaturescripts/scripts/ban/action.lua:14: in function <data/creaturescripts/scripts/ban/action.lua:7>
 
N used /ban > Account > Banishment + Deletion and got that :

PHP:
[17:5:59.980] [Error - CreatureScript Interface]
[17:5:59.980] data/creaturescripts/scripts/ban/action.lua:onChannelRequest
[17:5:59.981] Description:
[17:5:59.981] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)
[17:5:59.981] stack traceback:
[17:5:59.981]   [C]: in function 'ipairs'
[17:5:59.981]   data/lib/050-function.lua:10: in function 'isInArray'
[17:5:59.981]   data/creaturescripts/scripts/ban/action.lua:14: in function <data/creaturescripts/scripts/ban/action.lua:7>

So I dont have idea what is that. Sorry.

lib/050-function.lua script;
http://pastebin.com/kXBw4T1y
 
Back
Top