Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSay(cid, words, param)
- local t = string.explode(param, ",")
- local a = {
- [1] = 7,
- [2] = 14,
- [3] = 30,
- [4] = 60,
- [5] = 9999,
- [6] = 9999,
- [7] = 9999,
- [8] = 9999,
- [9] = 9999,
- [10] = 9999,
- [11] = 9999,
- }
- local b = a[t[3]]
- if not t[2] or tonumber(t[2]) or t[3] and not tonumber(t[3]) or t[4] then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Especifique nome,motivo,warnings(opcional).") return true
- elseif not getPlayerGUIDByName(t[1]) then
- doPlayerSendCancel(cid, "O jogador "..t[1].." não existe.") return true
- elseif isAccountBanished(getAccountIdByName(t[1])) then
- doPlayerSendCancel(cid, "O player "..t[1].." já está banido.") return true
- elseif t[3] and tonumber(t[3]) < 1 then
- doPlayerSendCancel(cid, "Desculpe, mas o mínimo de warnings é 1.") return true
- elseif t[3] and tonumber(t[3]) > 11 then
- doPlayerSendCancel(cid, "Desculpe, mas o máximo de warnings é 11.") return true
- elseif not getWarnings(t[1]) or getWarnings(t[1]) < 0 then
- setWarnings(t[1], 0)
- elseif t[3] and tonumber(t[3]) <= getWarnings(t[1]) then
- doPlayerSendCancel(cid, "Desculpe, mas esse player já tem "..getWarnings(t[1]).." warnings.") return true
- end
- if getPlayerByName(t[1]) then
- doRemoveCreature(getPlayerByName(t[1]))
- end
- if t[3] then
- doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..t[3]..".")
- broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..t[3]..". Comentário: "..t[2]..".")
- setWarnings(t[1], tonumber(t[3]))
- else
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..".")
- broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..". Comentário: "..t[2]..".")
- setWarnings(t[1], getWarnings(t[1])+1)
- doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement