Advertisement
LuckOake

RadBr Banishment System

Nov 4th, 2012
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. function onSay(cid, words, param)
  2.         local t = string.explode(param, ",")
  3.         local a = {
  4.             [1] = 7,
  5.             [2] = 14,
  6.             [3] = 30,
  7.             [4] = 60,
  8.             [5] = 9999,
  9.             [6] = 9999,
  10.             [7] = 9999,
  11.             [8] = 9999,
  12.             [9] = 9999,
  13.             [10] = 9999,
  14.             [11] = 9999,
  15.         }
  16.        
  17.         local b = a[t[3]]
  18.        
  19.         if not t[2] or tonumber(t[2]) or t[3] and not tonumber(t[3]) or t[4] then
  20.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Especifique nome,motivo,warnings(opcional).") return true
  21.         elseif not getPlayerGUIDByName(t[1]) then
  22.             doPlayerSendCancel(cid, "O jogador "..t[1].." não existe.") return true
  23.         elseif isAccountBanished(getAccountIdByName(t[1])) then
  24.             doPlayerSendCancel(cid, "O player "..t[1].." já está banido.") return true
  25.         elseif t[3] and tonumber(t[3]) < 1 then
  26.             doPlayerSendCancel(cid, "Desculpe, mas o mínimo de warnings é 1.") return true
  27.         elseif t[3] and tonumber(t[3]) > 11 then
  28.             doPlayerSendCancel(cid, "Desculpe, mas o máximo de warnings é 11.") return true
  29.         elseif not getWarnings(t[1]) or getWarnings(t[1]) < 0 then
  30.             setWarnings(t[1], 0)
  31.         elseif t[3] and tonumber(t[3]) <= getWarnings(t[1]) then
  32.             doPlayerSendCancel(cid, "Desculpe, mas esse player já tem "..getWarnings(t[1]).." warnings.") return true
  33.         end
  34.        
  35.         if getPlayerByName(t[1]) then
  36.             doRemoveCreature(getPlayerByName(t[1]))
  37.         end
  38.         if t[3] then
  39.             doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0)
  40.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..t[3]..".")
  41.             broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..t[3]..". Comentário: "..t[2]..".")
  42.             setWarnings(t[1], tonumber(t[3]))
  43.         else
  44.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..".")
  45.             broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..". Comentário: "..t[2]..".")
  46.             setWarnings(t[1], getWarnings(t[1])+1)
  47.             doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0)
  48.         end
  49. return true
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement