Muito bom caotic, otimo sistema ^^
- Fórum
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- Banimento System 1.0
CA
sistema
Banimento System 1.0
Por caotic, 12 de fev. de 2013 em Mods, funções e outros
banimento system
sistema de banimento
ban para 9.0
banimento
ban
otserv
tibia
script
5.0 (1)
3
1.6k
info
Grupo: Campones
Registrado: 22/08/12
Posts: 95
Reputação: +18
Char no Tibia: NoNick

12 de fevereiro de 2013 às 13:38
3 meses depois...
12 de maio de 2013 às 16:00
Olá, só não entendi uma coisa. Ban por ip? Como faz?
Eu li o script, só achei o get ip ban...
Mas a função pra dar ban ip não vi.
Na talkactions tem o true.
Mas não chama na função.
function getPlayerIpBan(cid)
local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`")
if ban:getID() == -1 then
return false
end
Ah, e a query, se vc quiser, pode substituir por essa:
CREATE TABLE `ban`
(
`player` INT NOT NULL,
`ip` INT NOT NULL,
`time` INT NOT NULL,
`coment` text
)
Acho que dara menos problemas.
Editado Maio 12 por Victor8


info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have
Venho trazer a versão do 1.0 do banimento system
Segue o link:
http://www.xtibia.co...to-system-beta/
O script foi todo reformulado.
O player fala /ban(nome do player,dias de ban,porque ele foi banido,["true" para banir o ip])
E o player e kikado e depois quando ele tentar logar aparece a mensagem de banimento.
O player também podera ver a lista de banidos dizendo /bans.
Vá na sua database e execute os seguintes comandos:
Vá em lib e crie um arquivo lua chamado de ban e coloque isto:
function setBanTime(cid, time, coment, ip) db.executeQuery("INSERT INTO `ban` VALUES (".. getPlayerGUID(cid) ..", ".. ip ..", ".. os.time() + time*36000 ..", '".. coment .."')") end function getPlayerBans(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") if ban:getID() == -1 then return false end local time = ban:getDataInt("time") > os.time() and ban:getDataInt("time") < 100+os.time() return time and false or true end function getPlayerComent(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataString("coment") end function getPlayerTimeBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataInt("time") - os.time() end function getPlayerIpBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") if ban:getID() == -1 then return false end while true do local ips = ban:getDataInt("ip") if getPlayerIp(cid) == ips then return true end if not ban:next() then return false end end end function doShowTextBans(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") str = "Players Banidos:\n\n" if ban:getID() == -1 then doShowTextDialog(cid, 1387, "Não existe nenhum player Banido") return true end while true do local name = ban:getDataInt("player") local player = getPlayerNameByGUID(name) local time = ban:getDataInt("time") - os.time() str = str .. player .. " - Banido por "..math.floor((time/36000)).." \n\n" if not ban:next() then doShowTextDialog(cid, 1397, str) break end end endVá em talkactions e crie um arquivo lua chamado de ban e coloque isto:
Continuando em talkactions crie um arquivo lua chamado de bans e coloque isto:
Agora vá em talkactions.xml e coloque estas tags:
Agora vá em creaturescripts e crie um arquivo lua chamado de ban e coloque isto:
Agora vá em login.lua e registre o evento colocando isto antes do ultimo return:
Coloque esta tag em talkactions.xml
Editado Fevereiro 12 por caotic