Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --белый список
- local white = {
- "DevilPuppy",
- "4epB9Ik",
- }
- local com = require('component')
- local event = require("event")
- local term = require('term')
- local radar = com.isAvailable("radar") and com.radar or error("нет радара")
- local gpu = com.gpu
- local w,h = gpu.getViewport()
- gpu.setResolution(35,15)
- function checkAdmin(text)
- for i = 1, 5 do
- if white[i] == text then
- return false
- end
- end
- return true
- end
- while true do
- local pl = radar.getPlayers()
- term.clear()
- gpu.setForeground(0xffb600)
- gpu.set(2,1, 'Игроков в кабинке:')
- for i = 1, #pl do
- gpu.setForeground(0xff0000)
- if checkAdmin(pl[i].name) then
- if math.floor(pl[i].distance)<256 then
- gpu.set(2, i+1, ' '..pl[i].name)
- gpu.set(20, i+1, ' - '..math.floor(pl[i].distance)..'м.')
- end
- end
- end
- local e = ({event.pull(5,"key_down")})[4]
- if e == 29 or e == 157 then -- Ctrl Выход
- gpu.setResolution(w,h)
- gpu.setBackground(0x000000)
- gpu.setForeground(0xFFFFFF)
- os.execute("cls")
- os.exit()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment