Ir para conteúdo

Featured Replies

  • Respostas 14
  • Visualizações 783
  • Created
  • Última resposta

Top Posters In This Topic

Postado

porque como ele falou não tem Rule Violation você leu o tópico ?

Postado
  • Autor

só esta dando kick no player que eu estou banido novamente ...

"Aqueles que não seguem as regras são considerados lixo...
mas... aqueles que abandonam seus amigos São piores que lixo."

68hvdf.jpg

Postado

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
end
Vá em talkactions e crie um arquivo lua chamado de ban e coloque isto:


function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
if param == " " or param == "" or not param or isNumeric(param) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)")
end
if t[2] == " " or t[2] == "" or not t[2] then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque os dias do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)")
end
if t[3] == " " or t[3] == "" or not t[3] then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o comentario do banimento dizendo /ban(nome do player,dias de ban,comentario)")
end
local player = getPlayerByNameWildcard(t[1], false)
if not player then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player "..t[1].." não existe")
end
setBanTime(player, t[2], t[3], t[4] == "true" and getPlayerIp(player) or 0)
doRemoveCreature(player)
return true
end

Continuando em talkactions crie um arquivo lua chamado de bans e coloque isto:
 

function onSay(cid, words, param, channel)
doShowTextBans(cid)
return true
end

Agora vá em talkactions.xml e coloque estas tags:
 



<talkaction words="/ban" event="script" value="ban.lua"/>
<talkaction words="/bans" event="script" value="bans.lua"/>


Agora vá em creaturescripts e crie um arquivo lua chamado de ban e coloque isto:
 

function onLogin(cid)
if getPlayerBans(cid) then
local time = math.floor(getPlayerTimeBan(cid)/36000)
doPlayerPopupFYI(cid, "Você esta banido por "..getPlayerComent(cid).." durante "..time.." dias")
return addEvent(doRemoveCreature, 180, cid)
end
if getPlayerIpBan(cid) then
doPlayerPopupFYI(cid, "Seu ip esta banido")
return addEvent(doRemoveCreature, 180, cid)
end
return true
end
Agora vá em login.lua e registre o evento colocando isto antes do ultimo return:
registerCreatureEvent(cid, "ban")

Coloque esta tag em talkactions.xml


<event type="login" name="ban" register = "1" event="script" value="ban.lua"/>

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.7k

Informação Importante

Confirmação de Termo