/ban nick, hora e comentario PERFEITO
Autor: NetoMalucao | Publicado: 2012-02-09T04:23:00-08:00


&nbsp;/Ban com nick, hora e comentárioNome:(Um Novo Modo De Banir...&nbsp;)
.Versão:&nbsp;(tfs 0.3.4+).
Tipo do script:&nbsp;(talkactions.xml(talkaction.).
Servidor&nbsp;Testado:&nbsp;(tfs 0.3.4+)

Creditos:&nbsp;(Gesior.Pl)&nbsp;.
Comentario:&nbsp;Como Ele Funciona...
/ban Nick - Banir O jogador de tempo predefinido
/ban Nick,12 - Banir O jogador por 12 horas
/ban Nick,35,AFK BOT - Banir jogador de 35 horas com o comentário "AFK BOT"
Você pode Banir O Player offline jogadores!
Adicone Isto

talkactions.xml
Código:&lt;talkaction log="yes" words="/ban" access="3" event="script" value="ban.lua"/&gt;

Crie O Nome Do Arquivo&nbsp;ban.lua

Código: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 &gt; 0) then
            local lenght = default_lenght
            local comment = default_comment
            if(parametres[2] ~= nil and tonumber(parametres[2]) &gt; 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  Caso o 1º Script Não Funcione Use Esse...&nbsp;Por:&nbsp;Hermes

Código:&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;mod name="/ban command" version="1.0" author="Gesior.pl &amp; modded by Hermes" contact="otland.net" enabled="yes"&gt;
    &lt;description&gt;
        This mod will add new command for server staff - /ban.
        Usage:
            /ban Nick - ban player for default time (set in config)
            /ban Nick,12 - ban player for 12 hours
            /ban Nick,35,AFK BOT - ban player for 35 hours with comment "AFK BOT" 
    &lt;/description&gt;
    &lt;config name="banishment_config"&gt;&lt;![CDATA[
        banconfig = {
            default_comment = ""
            default_lenght = 1 -- ban time in hours
        }
    ]]&gt;&lt;/config&gt;
    &lt;talkaction log="yes" words="/ban" access="3" event="buffer"&gt;&lt;![CDATA[
        domodlib('banishment_config')
        function onSay(cid, words, param)
            local parametres = string.explode(param, ",")
                if(parametres[1] ~= nil) then
                    local accId = getAccountIdByName(parametres[1])
                    if(accId &gt; 0) then
                        local lenght = banconfig.default_lenght
                        local comment = banconfig.default_comment
                        if(parametres[2] ~= nil and tonumber(parametres[2]) &gt; 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  
    ]]&gt;&lt;/talkaction&gt;
&lt;/mod&gt;De
local&nbsp;default_lenght&nbsp;=&nbsp;1&nbsp;-- ban time in hoursPara
local&nbsp;default_lenght&nbsp;=&nbsp;24&nbsp;-- ban time in hours
Se você quiser mudá-lo de "horas" para "dia" (como padrão 1 dia e / ban Nick, 2, botting ban por 2 dias), você deve mudar:
doAddBanishment(accId,&nbsp;lenght * 3600, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)doAddBanishment(accId,&nbsp;lenght * 3600 * 24, 23, ACTION_BANISHMENT, comment, getPlayerGUID(cid), comment)Se Você Muda
local default_lenght&nbsp;=&nbsp;24&nbsp;--&nbsp;ban time in hours


Por Mock.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 &gt; 0) then
local lenght = default_lenght
local comment = default_comment
if(parametres[2] ~= nil and tonumber(parametres[2]) &gt; 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
]=]
}Thanks,&nbsp;Mock
Como Usa Essa Função./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"
/ban Nick,0.02,1 minute ban - dont spam!


Caso De Erros Poste Aqui.http://forums.otserv.com.br/f13/

Aviso&nbsp;Não Flood Usem O&nbsp;Thanks...