• 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!

Lua Ban comand otx 8.60

kleitonalan

New Member
Joined
Mar 21, 2013
Messages
289
Reaction score
3
[1/3/2014 21:11:12] [Error - CreatureScript Interface]
[1/3/2014 21:11:12] data/creaturescripts/scripts/ban/action.lua:onChannelRequest
[1/3/2014 21:11:12] Description:
[1/3/2014 21:11:12] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)
[1/3/2014 21:11:12] stack traceback:
[1/3/2014 21:11:12] [C]: in function 'ipairs'
[1/3/2014 21:11:12] data/lib/050-function.lua:10: in function 'isInArray'
[1/3/2014 21:11:12] data/creaturescripts/scripts/ban/action.lua:14: in function <data/creaturescripts/scripts/ban/action.lua:7>
[1/3/2014 21:11:28] Lolzz has logged out.
[1/3/2014 21:11:29] Lol has logged out.

[1/3/2014 21:11:29] [Error - CreatureScript Interface]
[1/3/2014 21:11:29] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[1/3/2014 21:11:29] Description:
[1/3/2014 21:11:29] (LuaInterface::luaGetPlayerNameByGUID) Player not found

[1/3/2014 21:11:29] [Error - CreatureScript Interface]
[1/3/2014 21:11:29] data/creaturescripts/scripts/ban/finish.lua:onTextEdit
[1/3/2014 21:11:29] Description:
[1/3/2014 21:11:29] data/creaturescripts/scripts/ban/finish.lua:225: attempt to concatenate a nil value
[1/3/2014 21:11:29] stack traceback:
[1/3/2014 21:11:29] data/creaturescripts/scripts/ban/finish.lua:225: in function <data/creaturescripts/scripts/ban/finish.lua:10>

doPlayerSendChannels(cid, TYPE_ACCESS[getPlayerAccess(cid)])
registerCreatureEvent(cid, "Ban_Type")
return true
end
 
Last edited:
ban/action.lua
Code:
local ACCESS = {
    [1] = { 8 },
    [2] = { 1, 2, 4, 5, 7, 9 },
    [3] = { 1, 2, 3, 4, 5, 6, 7, 9 }
}

function onChannelRequest(cid, channel, custom)
    unregisterCreatureEvent(cid, "Ban_Action")
    if(not custom or type(channel) ~= 'number') then
        doPlayerSendCancel(cid, "Invalid action.")
        return false
    end

    if(not isInArray(ACCESS[getPlayerAccess(cid)], channel)) then
        doPlayerSendCancel(cid, "You cannot do this action.")
        return false
    end

    local output = "Name:\n\nComment:\n"
    if(isInArray({1, 5}, channel)) then
        output = "Name:\n\n(Optional) Length:\n\nComment:\n"
    end

    doShowTextDialog(cid, 2599, output, true, 1024)
    doCreatureSetStorage(cid, "banConfig", table.serialize({
        type = (channel > 4 and 2 or 1),
        subType = channel
    }))

    registerCreatureEvent(cid, "Ban_Finish")
    return false
end


http://pastebin.com/68SPhwrc finish.lua
 
Back
Top