Advertisement
ogrezem

pim.lua

Jul 2nd, 2017 (edited)
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. local component = require("component")
  2. local pim = component.pim
  3. local debug = component.debug
  4. local cmd = component.opencb.execute
  5. local term = require("term")
  6. local cb = component.opencb
  7. term.clear()
  8.  
  9.  
  10. local function checkInv(name)
  11.     for i=1,40 do
  12.       if pim.getStackInSlot(i)~=nil then
  13.         return true
  14.       end
  15.     end
  16.     return false
  17. end
  18.  
  19. while true do
  20.   name = pim.getInventoryName()
  21.   if name ~= "pim" then
  22.     print("Обнаружен игрок "..name)
  23.     if checkInv(name) then
  24.        debug.getPlayer(name).setPosition(612,35,766)
  25.        cb.execute("msg " .. name .. " &6Сначала очисти свой инвентарь!")
  26.     else
  27.     cb.execute("fly " .. name .. " off")
  28.     cb.execute("god " .. name .. " off")
  29.     _,res = cb.execute("pvpadmin " .. name)
  30.     if string.find(res,"false") then cb.execute("pvpadmin " .. name) end
  31.     debug.getPlayer(name).setPosition(612,26,777)
  32.     print("Игроку " .. name .. " был выключен fly и god\n")
  33.   end
  34. end
  35.   os.sleep(0.2)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement