Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Bolodefchoco << Criador da Script!
- --06/11/2015
- --[[ Comandos:
- !ban Nickname - Bane o jogador (Matar, Nome preto, Não pode ver nada)
- !unban Nickname - Retira o ban do jogador (Revive, Nome normal, Agora pode ver tudo)
- ]]--
- ban = {}
- is=function(t,n)
- local is=false
- for i,v in pairs (t) do
- if n==v then
- is=true
- break
- end
- end
- return is
- end
- banned = function(n)
- if is(ban,n) then
- tfm.exec.killPlayer(n)
- tfm.exec.setNameColor(n,1)
- ui.addTextArea(99999999999,'',n,-1500,-1500,3000,3000,1,1,1,true)
- else
- tfm.exec.respawnPlayer(n)
- tfm.exec.setNameColor(n,false)
- ui.removeTextArea(99999999999,n)
- end
- end
- string.nick=function(n)
- local v = 1
- if n:sub(0,1)~="+" then local v = 2 end
- return n:sub(0,v):upper()..n:sub(v+1):lower()
- end
- table.destroy=function(t,k)
- for i,v in pairs (t) do
- if k==v then
- table.remove(t,i)
- break
- end
- end
- end
- eventNewPlayer = function(n)
- banned(n)
- end
- for n in pairs (tfm.get.room.playerList) do eventNewPlayer(n) end
- eventNewGame = function() for n in pairs(tfm.get.room.playerList) do banned(n) end end
- eventChatCommand = function(n,c)
- local p={}
- for arg in c:gmatch('[^%s]+') do
- table.insert(p,arg)
- end
- p[1] = string.lower(p[1])
- if p[1]=='ban' then
- if p[2] and tfm.get.room.playerList[string.nick(p[2])] then
- table.insert(ban,string.nick(p[2]))
- banned(string.nick(p[2]))
- end
- elseif p[1]=='unban' then
- if p[2] and tfm.get.room.playerList[string.nick(p[2])] and is(ban,string.nick(p[2])) then
- table.destroy(ban,string.nick(p[2]))
- banned(string.nick(p[2]))
- end
- end
- system.disableChatCommandDisplay('ban',true)
- system.disableChatCommandDisplay('unban',true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement