testa:
function onSay(cid, words, param, channel)local t = string.explode(param, ",")local name, days, boolean, motivo = t[1], tonumber(t[2]), t[3], t[4]if param == '' or not days or not name or not motivo then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite /ban nome,dias, true ou false (true para IP Banishment), motivo.") return true endlocal acc = getAccountIdByName(name)local player_ip = getPlayerIp(getPlayerByNameWildcard(name)) if acc ~= 0 then if tostring(boolean) ~= "true" and tostring(boolean) ~= "false" then doPlayerSendTextMessage(cid, "O terceiro parâmetro deve ser true ou false. \n true = ban ip.\n /ban nome, dias, true ou false, motivo.") return true end if tostring(boolean) == "false" 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(tostring(name)).. " foi banido por ".. getCreatureName(cid).. ". Motivo:\n".. motivo .. ".", 25) addEvent(doRemoveCreature, 3*1000, getPlayerByNameWildcard(name), true) else doAddIpBanishment(player_ip) doBroadcastMessage("O IP do jogador ".. getCreatureName(tostring(name)).. " foi banido! Autor do banimento: ".. getCreatureName(cid).. ". \n Motivo:\n".. motivo .. ".", 25) addEvent(doRemoveCreature, 3*1000, getPlayerByNameWildcard(name), true) return true end endend











info
Grupo: Visconde
Registrado: 15/03/16
Posts: 327
Reputação: +12
Gênero: Masculino
Eae Galera blz ? eu queria pedir a vocês para editar essa script de ban para min, queria que tivesse como escolher se queria fosse ban ip ou não, ae o comando ficasse assim: /ban NICKPLAYER, DIAS, NAO OU SIM(BAN IP OU NAO), MOTIVO.
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
Se alguém poder min ajuda, desde já, meu muito OBRIGADO <3