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

TalkAction How To Ban ppl With Command ..

Status
Not open for further replies.

3mR

Mapper
Joined
May 29, 2012
Messages
322
Reaction score
42
Hello ! ...
Rep+ ..
HTML:
/ban Nick - ban player for default time
/ban Nick,12 - ban player for 12 hours
/ban Nick,35,AFK BOT - ban player for 35 hours with comment "AFK BOT"

to bann ofline players..
add this code in talkactions.xml
Code:
<talkaction log="yes" words="/ban" access="3" event="script" value="ban.lua"/>
then open script and carte file with name ban and copy this code
PHP:
local default_comment = ""
local default_lenght = 1 -- ban time in 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 name.")
    end
    return true
end
Rep+ if i help you >.<
 
Okay, if you are really great at scripting,
I need a script that bans a guy with a item. ^^
 
i am not graet :D
when i know something , i share it to all know it .. xx
it's not your work tonks
shut up .. :mad:
 
Status
Not open for further replies.
Back
Top