Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local admin = debug.traceback():match('%w-#%d+')
- for _,d in next, {'AfkDeath','AutoNewGame','AutoShaman'} do
- tfm.exec['disable'..d]()
- end
- system.bindKeyboard(admin,32,true,true)
- system.disableChatCommandDisplay()
- local xml,author,code
- eventNewGame = function()
- table.foreach(tfm.get.room.playerList, function(k,v) tfm.exec.setPlayerNightMode(false,k) end)
- if tfm.get.room.xmlMapInfo then
- code = tfm.get.room.xmlMapInfo.mapCode
- author = tfm.get.room.xmlMapInfo.author
- xml = tfm.get.room.xmlMapInfo.xml
- ui.setMapName('<J>'..author..'</J><BL> - @'..code..'</BL>')
- else
- xml = nil
- end
- tfm.get.room.xmlMapInfo = nil
- end
- eventChatCommand = function(name,cmd)
- if name == admin then
- local p = {}
- for w in cmd:gmatch('[^%s]+') do
- p[#p + 1] = w
- end
- if p[1] == 'map' or p[1] == 'np' then
- local map = p[2] and p[2]:match('[@#]%d+') or '@0'
- tfm.exec.newGame(map)
- end
- end
- end
- eventKeyboard = function(name,_,p)
- if xml then
- print(xml:gsub('<','<'))
- end
- end
- eventPlayerDied = function(name)
- tfm.exec.setPlayerNightMode(false,name)
- tfm.exec.respawnPlayer(name)
- end
- eventNewPlayer = function(name)
- tfm.exec.setPlayerNightMode(false,name)
- tfm.exec.respawnPlayer(name)
- end
- eventPlayerWon = function(name)
- tfm.exec.setPlayerNightMode(false,name)
- tfm.exec.respawnPlayer(name)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement