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

Help with /ban command

JacobC

New Member
Joined
Apr 7, 2009
Messages
34
Reaction score
1
This is my ban script.

Code:
local default_comment = ""
local default_lenght = 1 -- 1 = 1 hour, 2 = 2 hours

function onSay(cid, words, param)
    local parametres = string.explode(param, ",")
    if(parametres[1] ~= nil) then
        local accId = getAccountIdByName(parametres[1])
        if(accId > 0) then
            local lenght = default_lenght
            local comment = default_comment
            if(parametres[2] ~= nil and tonumber(parametres[2]) > 0) then
                lenght = tonumber(parametres[2])
            end
            if(parametres[3] ~= nil) then
                comment = parametres[3]
            end
            doAddBanishment(accId, lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)
            local player = getPlayerByNameWildcard(parametres[1])
            if(isPlayer(player) == TRUE) then
                doRemoveCreature(player)
            end
        else
            doPlayerSendCancel(cid, "Player with name " .. parametres[1] .. " doesn't exist.")
        end
    else
        doPlayerSendCancel(cid, "You must enter a name.")
    end
    return true
end

Whenever im trying to imply it on someone it says the following error:

[10/10/2009 19:00:00] data/talkactions/scripts/ban.lua:17: attempt to call global 'doAddBanishment' (a nil value)
[10/10/2009 19:00:00] stack traceback:
[10/10/2009 19:00:00] data/talkactions/scripts/ban.lua:17: in function <data/talkactions/scripts/ban.lua:4>

I'm using the ban command like this:
/ban name
 
Back
Top Bottom