Advertisement
CREONIX

FIND USER DOOR | DARKRP

Sep 1st, 2017
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. /*
  2.  
  3. Скриншот - https://steamuserimages-a.akamaihd.net/ugc/849347654003267205/3D68480639F23E9DC684C6A0FA55C9CFA677EB10/
  4.  
  5. Команды :
  6. Показать двери - show_door
  7. Скрыть двери - hide_door
  8.  
  9. */
  10. concommand.Add("show_door", function()
  11.  
  12. hook.Add("HUDPaint" , "DoorFind" , function ()
  13.    
  14.     for k,v in pairs (ents.GetAll()) do
  15.        
  16.         if IsValid(v) and v:getDoorOwner() then
  17.  
  18.             local pos = v:GetPos():ToScreen()
  19.        
  20.             local distance = math.floor(LocalPlayer():GetPos():Distance(v:GetPos()) / 25)
  21.                
  22.             draw.DrawText(distance.."m", "ChatFont", pos.x, pos.y - 10,Color(255, 255, 255, 255),1)
  23.                
  24.             draw.DrawText("Дверь - "..v:getDoorOwner():Nick(), "TargetIDSmall", pos.x + 1, pos.y - 30,Color(255, 255, 255, 255),1)
  25.                    
  26.             surface.SetDrawColor(255,255,255,255)
  27.                    
  28.             surface.SetMaterial(Material( "icon16/door.png" ))
  29.                
  30.             surface.DrawTexturedRect(pos.x-10, pos.y-50, 16,16)    
  31.                
  32.         end
  33.        
  34.     end
  35.  
  36. end)
  37.  
  38. end)
  39.  
  40. concommand.Add("hide_door", function()
  41. hook.Remove("HUDPaint" , "DoorFind")
  42. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement