Advertisement
Tectoon

[TFM] Untitled

Dec 18th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. --Bolodefchoco << Criador da Script!
  2. --06/11/2015
  3.  
  4. --[[ Comandos:
  5.     !ban Nickname - Bane o jogador (Matar, Nome preto, Não pode ver nada)
  6.     !unban Nickname - Retira o ban do jogador (Revive, Nome normal, Agora pode ver tudo)
  7. ]]--
  8.  
  9. ban = {}
  10. is=function(t,n)
  11.     local is=false
  12.     for i,v in pairs (t) do
  13.         if n==v then
  14.             is=true
  15.             break
  16.         end
  17.     end
  18.     return is
  19. end
  20. banned = function(n)
  21.     if is(ban,n) then
  22.         tfm.exec.killPlayer(n)
  23.         tfm.exec.setNameColor(n,1)
  24.         ui.addTextArea(99999999999,'',n,-1500,-1500,3000,3000,1,1,1,true)
  25.     else
  26.         tfm.exec.respawnPlayer(n)
  27.         tfm.exec.setNameColor(n,false)
  28.         ui.removeTextArea(99999999999,n)
  29.     end
  30. end
  31. string.nick=function(n)
  32.         local v = 1
  33.         if n:sub(0,1)~="+" then local v = 2 end
  34.         return n:sub(0,v):upper()..n:sub(v+1):lower()
  35. end
  36. table.destroy=function(t,k)
  37.         for i,v in pairs (t) do
  38.                 if k==v then
  39.                         table.remove(t,i)
  40.                         break
  41.                 end
  42.         end
  43. end
  44. eventNewPlayer = function(n)
  45.     banned(n)
  46. end
  47. for n in pairs (tfm.get.room.playerList) do eventNewPlayer(n) end
  48. eventNewGame = function() for n in pairs(tfm.get.room.playerList) do banned(n) end end
  49. eventChatCommand = function(n,c)
  50.     local p={}
  51.     for arg in c:gmatch('[^%s]+') do
  52.         table.insert(p,arg)
  53.     end
  54.     p[1] = string.lower(p[1])
  55.     if p[1]=='ban' then
  56.         if p[2] and tfm.get.room.playerList[string.nick(p[2])] then
  57.             table.insert(ban,string.nick(p[2]))
  58.             banned(string.nick(p[2]))
  59.         end
  60.     elseif p[1]=='unban' then
  61.         if p[2] and tfm.get.room.playerList[string.nick(p[2])] and is(ban,string.nick(p[2])) then
  62.             table.destroy(ban,string.nick(p[2]))
  63.             banned(string.nick(p[2]))
  64.         end
  65.     end
  66.     system.disableChatCommandDisplay('ban',true)
  67.     system.disableChatCommandDisplay('unban',true)
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement