Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isBanned={}
- function table.contains(t,element)
- if element==nil then
- return false
- end
- for key,value in pairs(t) do
- if value==element then
- return true
- end
- end
- return false
- end
- function table.delete(t,v)
- for key,value in ipairs(t) do
- if v == t[key] then
- table.remove(t, key)
- end
- end
- end
- function eventNewGame()
- for name,player in pairs(tfm.get.room.playerList) do
- if table.contains(isBanned,player) then
- tfm.exec.killPlayer(player)
- end
- end
- end
- function eventPlayerRespawn(name)
- if table.contains(isBanned,name) then
- tfm.exec.killPlayer(name)
- end
- end
- function eventChatCommand(name,cmd)
- local arg={}
- for argument in cmd:gmatch("[^%s]+") do
- table.insert(arg, argument);
- end
- if arg[1]=="ban" then
- table.insert(isBanned,arg[2])
- elseif arg[1]=="unban" then
- table.delete(isBanned,arg[2])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment