Ir para conteúdo

Featured Replies

Postado

Bom, gostaria de pedir um sistema de ban para TFS 0.3.7, pois várias que vi aqui no TK nenhuma deu certo. REP++

 

 

Erro

[22:35:52.326] [Error - TalkAction Interface]


[22:35:52.326] local cid = 268450259
[22:35:52.326] local words = "/ban"
[22:35:52.326] local param = "Gambit, as,1"
[22:35:52.327] local channel = 65534
[22:35:52.327] domodlib('radban')
[22:35:52.327] local t = string.explode(param, ",")
[22:35:52.327] local a = {
[22:35:52.328] [1] = 7,
[22:35:52.328] [2] = 14,
[22:35:52.328] [3] = 30,
[22:35:52.328] [4] = 60,
[22:35:52.328] [5] = 9999,
[22:35:52.329] [6] = 9999,
[22:35:52.329] [7] = 9999,
[22:35:52.329] [8] = 9999,
[22:35:52.329] [9] = 9999,
[22:35:52.329] [10] = 9999,
[22:35:52.330] [11] = 9999,
[22:35:52.330] }
[22:35:52.330]
[22:35:52.330] local b = a[t[3]]
[22:35:52.330]
[22:35:52.331] if not t[2] or tonumber(t[2]) or t[3] and not ton
umber(t[3]) or t[4] then
[22:35:52.331] doPlayerSendTextMessage(cid, MESSAGE_STAT
US_CONSOLE_BLUE, "Especifique nome,motivo,warnings(opcional).") return true
[22:35:52.331] elseif not getPlayerGUIDByName(t[1]) then
[22:35:52.331] doPlayerSendCancel(cid, "O jogador "..t[1
].." nÒo existe.") return true
[22:35:52.332] elseif isAccountBanished(getAccountIdByName(t[1])
) then
[22:35:52.332] doPlayerSendCancel(cid, "O player "..t[1]
.." jß estß banido.") return true
[22:35:52.332] elseif t[3] and tonumber(t[3]) < 1 then
[22:35:52.332] doPlayerSendCancel(cid, "Desculpe, mas o
mÝnimo de warnings Ú 1.") return true
[22:35:52.332] elseif t[3] and tonumber(t[3]) > 11 then
[22:35:52.333] doPlayerSendCancel(cid, "Desculpe, mas o
mßximo de warnings Ú 11.") return true
[22:35:52.333] elseif not getWarnings(t[1]) or getWarnings(t[1])
< 0 then
[22:35:52.333] setWarnings(t[1], 0)
[22:35:52.333] elseif t[3] and tonumber(t[3]) <= getWarnings(t[1
]) then
[22:35:52.334] doPlayerSendCancel(cid, "Desculpe, mas es
se player jß tem "..getWarnings(t[1]).." warnings.") return true
[22:35:52.334] end
[22:35:52.334]
[22:35:52.334] if getPlayerByName(t[1]) then
[22:35:52.334] doRemoveCreature(getPlayerByName(t[1]))
[22:35:52.335] end
[22:35:52.335] if t[3] then
[22:35:52.336] doAddAccountBanishment(getAccountIdByName
(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0)
[22:35:52.336] doPlayerSendTextMessage(cid, MESSAGE_STAT
US_CONSOLE_BLUE, "VocÛ baniu o jogador "..t[1]..". Warnings setadas de "..getWar
nings(t[1]).." para "..t[3]..".")
[22:35:52.336] broadcastMessage("Jogador "..t[1].." noti
ficado por "..getCreatureName(cid)..". Notificaþ§es setadas de "..getWarnings(t[
1]).." para "..t[3]..". Comentßrio: "..t[2]..".")
[22:35:52.336] setWarnings(t[1], tonumber(t[3]))
[22:35:52.337] else
[22:35:52.337] doPlayerSendTextMessage(cid, MESSAGE_STAT
US_CONSOLE_BLUE, "VocÛ baniu o jogador "..t[1]..". Warnings setadas de "..getWar
nings(t[1]).." para "..(getWarnings(t[1])+1)..".")
[22:35:52.337] broadcastMessage("Jogador "..t[1].." noti
ficado por "..getCreatureName(cid)..". Notificaþ§es setadas de "..getWarnings(t[
1]).." para "..(getWarnings(t[1])+1)..". Comentßrio: "..t[2]..".")
[22:35:52.337] setWarnings(t[1], getWarnings(t[1])+1)
[22:35:52.338] doAddAccountBanishment(getAccountIdByName
(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0)
[22:35:52.338] end
[22:35:52.338] return true

[22:35:52.338] Description:
[22:35:52.339] [string "LuaInterface::loadBuffer"]:44: attempt to concatenate a
nil value
[22:35:53.694] Gambit has logged in.

 

Script

function onSay(cid, words, param, channel)

 
 
local t = string.explode(param, ",")
if param == '' or not days or not name or not motivo then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite /ban nome,dias,motivo.") return true end
local name, days = t[1], tonumber(t[2])
local motivo = t[3]
local acc = getAccountIdByName(name)
if acc ~= 0 then
local tempo = days * 24 * 3600
doAddAccountBanishment(acc, target, os.time() + tempo, 5, 2, 'Você foi banido por "..motivo..",por "..tempo.." !.', 0)
doBroadcastMessage("O jogador ".. getCreatureName(target).. " foi banido por ".. getCreatureName(cid).. ". Motivo:\n".. motivo .. ".", 25)
addEvent(doRemoveCreature, 3*1000, target, true)
return true
end
end

Editado por Sadness (veja o histórico de edições)

Resolvido por QuebradaZN

Ir para solução
Postado

Talkactions/scripts/ban.lua

function onSay(cid, words, param, channel)

local param = string.explode(param, ",")


local bantypes = { 
["ip"] = function() doAddIpBanishment(getIpByName(param[2]) ) return true end,--, mask[, length[, reason[, comment[, admin[, statement]]]]]]),
["name"] = function() doAddPlayerBanishment(param[2]) return true end,--}, type[, length[, reason[, action[, comment[, admin[, statement]]]]]]]),
["account"] = function() doAddAccountBanishment(getAccountIdByName(param[2]) ) return true end,--, playerId[, length[, reason[, action[, comment[, admin[, statement]]]]]]]),
}
--[[
doRemoveIpBanishment(ip[, mask])
doRemovePlayerBanishment(name/guid, type)
doRemoveAccountBanishment(accountId[, playerId])
]]




if words == "/ban" then 


for i, j in pairs(bantypes) do
      if (string.lower(param[1]) == i) then
       doRemoveCreature(getCreatureByName(param[2]), true)
       return j() and doBroadcastMessage(" [BAN ADVISE]--> O Staff: ["..getCreatureName(cid).."] Baniu o player ["..param[2].."] por "..i..".", MESSAGE_STATUS_WARNING)
      end     
    end
end


return true
end

Talkactions/talkactions.xml Adicione ou Altere a Tag:

<talkaction log="yes" access="5" words="/ban" event="script" value="ban.lua"/>

Exemplo de como usar o Comando:

/ban ip, NOME DO PLAYER
/ban account, NOME DO PLAYER
/ban name, NOME DO PLAYER

Se Ajudei, REP!

Editado por PobrePreto (veja o histórico de edições)

"Ainda que eu ande pelo vale da sombra da morte, não temerei mal algum, pois tu estás comigo. Salmos 23:4"

 

Postado
  • Autor

Talkactions/scripts/ban.lua

function onSay(cid, words, param, channel)

local param = string.explode(param, ",")


local bantypes = { 
["ip"] = function() doAddIpBanishment(getIpByName(param[2]) ) return true end,--, mask[, length[, reason[, comment[, admin[, statement]]]]]]),
["name"] = function() doAddPlayerBanishment(param[2]) return true end,--}, type[, length[, reason[, action[, comment[, admin[, statement]]]]]]]),
["account"] = function() doAddAccountBanishment(getAccountIdByName(param[2]) ) return true end,--, playerId[, length[, reason[, action[, comment[, admin[, statement]]]]]]]),
}
--[[
doRemoveIpBanishment(ip[, mask])
doRemovePlayerBanishment(name/guid, type)
doRemoveAccountBanishment(accountId[, playerId])
]]




if words == "/ban" then 


for i, j in pairs(bantypes) do
      if (string.lower(param[1]) == i) then
       doRemoveCreature(getCreatureByName(param[2]), true)
       return j() and doBroadcastMessage(" [BAN ADVISE]--> O Staff: ["..getCreatureName(cid).."] Baniu o player ["..param[2].."] por "..i..".", MESSAGE_STATUS_WARNING)
      end     
    end
end


return true
end

Talkactions/talkactions.xml Adicione ou Altere a Tag:

<talkaction log="yes" access="5" words="/ban" event="script" value="ban.lua"/>

Exemplo de como usar o Comando:

/ban ip, NOME DO PLAYER
/ban account, NOME DO PLAYER
/ban name, NOME DO PLAYER

Se Ajudei, REP!

Não funcionou, e não apareceu nenhum erro.

Postado
  • Solução

Deu Reload ou reinicio o Servidor? Porque funciona Perfeitamente!

Script Feita Pelo @Caronte

Por Algum acaso você Tirou a Linha do outro /ban la na Tag?

Talvez largar 2 comandos iguais com Funções diferentes da conflito!

Editado por PobrePreto (veja o histórico de edições)

"Ainda que eu ande pelo vale da sombra da morte, não temerei mal algum, pois tu estás comigo. Salmos 23:4"

 

Postado
  • Autor

Deu Reload ou reinicio o Servidor? Porque funciona Perfeitamente!

Script Feita Pelo @Caronte

Por Algum acaso você Tirou a Linha do outro /ban la na Tag?

Talvez largar 2 comandos iguais com Funções diferentes da conflito!

Mano, só tem 1 tag que é do seu scritp, removi tudo de ban, o da pasta mods e tudo. Só ficou o seu.

O ban faz o player tomar 1 kick e ele pode voltar normalmente.

Editado por Sadness (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo