Advertisement
Guest User

Printers

a guest
May 3rd, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.32 KB | None | 0 0
  1. include("shared.lua")
  2.  
  3. function ENT:Initialize()
  4.     surface.CreateFont( "CusNameText", {
  5.             font = "Tahoma",
  6.             size = 26,
  7.             weight = 500,
  8.             antialias = true
  9.         } )
  10.     surface.CreateFont( "CusDescText", {
  11.             font = "Tahoma",
  12.             size = 17,
  13.             weight = 1000,
  14.             antialias = true
  15.         } )
  16. end
  17.  
  18.  
  19. function ENT:Draw()
  20.     self:DrawModel()
  21.     local Pos = self:GetPos()
  22.     local Ang = self:GetAngles()
  23.     local owner = self:Getowning_ent()
  24.     if self:GetNetworkedInt( "printer_timer" ) then
  25.         rate = math.Round((((Prc.PrintInitialValue6 + Prc.PrintSecondValue6 ) / 2 ) / Prc.Timer )).. " seconds"
  26.     else
  27.         rate = math.Round(((Prc.PrintInitialValue6 + Prc.PrintSecondValue6 ) / 2 )).. " seconds"
  28.     end
  29.     owner = (IsValid(owner) and owner:Nick()) or "unknown"
  30.     Ang:RotateAroundAxis(Ang:Up(), 90)
  31.     txt2 = "$" ..self:GetNWInt("PrintA")
  32.    
  33.     cam.Start3D2D(Pos + Ang:Up() * 11.5, Ang, 0.11)
  34.         draw.RoundedBox( 0, -135, 60, 275, 75, Color( 0, 0, 0, 100 ) )
  35.         draw.RoundedBox( 0, -135, -145, 275, 75, Color( 0, 0, 0, 100 ) )
  36.    
  37.         draw.WordBox(2, -110, -125, Prc.PrinterName6, "CusNameText", Color(0, 0, 0, 0), Color(255,255,255,255))
  38.         draw.WordBox(2, -60, -100, "Rate: " ..rate, "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  39.         draw.WordBox(2, -120, 60, "Owner: ".. owner, "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  40.         draw.WordBox(2, -120, 90, "Storage Money: " ..txt2, "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  41.        
  42. -- Printers Improvements ( CL )
  43. --------------------------------------------------------------------------------------------------------------------------------------------   
  44.     local Cooler = "Not Installed"
  45.     local Overclocker = "Not Installed"
  46.     local Improvement = "Not Installed"
  47.     if self:GetNetworkedInt( "printer_cooler", true) then Cooler = "Installed" end
  48.     if self:GetNetworkedInt( "printer_amount", true) then Improvement = "Installed" end
  49.     if self:GetNetworkedInt( "printer_timer", true) then Overclocker = "Installed" end
  50.     if Prc.Configurations then
  51.         draw.RoundedBox( 0, -135, -40, 275, 75, Color( 0, 0, 0, 100 ) )
  52.         draw.WordBox(2, -120, -40, "Cooler Upgrade: ", "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  53.             draw.WordBox(2, 10, -40, Cooler, "CusDescText", Color(0, 0, 0, 0), Color(0,161,255,255))
  54.         draw.WordBox(2, -120, -20, "Speed Upgrade: ", "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  55.             draw.WordBox(2, 10, -20, Overclocker, "CusDescText", Color(0, 0, 0, 0), Color(0,161,255,255))
  56.         draw.WordBox(2, -120, 0, "Print Upgrade: ", "CusDescText", Color(0, 0, 0, 0), Color(255,255,255,255))
  57.             draw.WordBox(2, 10, 0, Improvement, "CusDescText", Color(0, 0, 0, 0), Color(0,161,255,255))
  58.     end
  59.     if Prc.Configurations and Prc.Borders  then            
  60.         draw.RoundedBox( 0, -135, -145, 275, 10, Color(0,0,0,100))
  61.         draw.RoundedBox( 0, -135, -80, 275, 10, Color(0,0,0,100))
  62.                    
  63.         draw.RoundedBox( 0, -135, -50, 275, 10, Color(0,0,0,100))
  64.         draw.RoundedBox( 0, -135, -50, 275, 10, Color(0,0,0,100))
  65.         draw.RoundedBox( 0, -135, 25, 275, 10, Color(0,0,0,100))
  66.                    
  67.         draw.RoundedBox( 0, -135, 50, 275, 10, Color(0,0,0,100))
  68.         draw.RoundedBox( 0, -135, 50, 275, 10, Color(0,0,0,100))
  69.         draw.RoundedBox( 0, -135, 125, 275, 10, Color(0,0,0,100))
  70.                    
  71.         draw.RoundedBox( 0, -135, 60, 10, 65, Color(0,0,0,100))
  72.         draw.RoundedBox( 0, -135, -40, 10, 65, Color(0,0,0,100))
  73.         draw.RoundedBox( 0, -135, -135, 10, 55, Color(0,0,0,100))
  74.         draw.RoundedBox( 0, 130, -135, 10, 55, Color(0,0,0,100))
  75.         draw.RoundedBox( 0, 130, -40, 10, 65, Color(0,0,0,100))
  76.         draw.RoundedBox( 0, 130, 60, 10, 65, Color(0,0,0,100))
  77.  
  78.         if Prc.StealingSystemShowIcon then
  79.             if self:GetNetworkedInt( "printer_stealing" ) then
  80.                     surface.SetMaterial(Prc.SecurityIcon)
  81.                     surface.SetDrawColor(255, 255, 255, 255)
  82.                     surface.DrawTexturedRect(110, 105 , 16, 16)
  83.                 else
  84.                     surface.SetMaterial(Prc.SecurityIcon)
  85.                     surface.SetDrawColor(0, 0, 0, 255)
  86.                     surface.DrawTexturedRect(110, 105 , 16, 16)
  87.             end
  88.         end    
  89.         if Prc.SilencerShowIcon then
  90.             if self:GetNetworkedInt( "printer_silencer" ) then
  91.                         surface.SetMaterial(Prc.SilencerIcon)
  92.                         surface.SetDrawColor(255, 255, 255, 255)
  93.                         surface.DrawTexturedRect(90, 105 , 16, 16)
  94.                     else
  95.                         surface.SetMaterial(Prc.SilencerIcon)
  96.                         surface.SetDrawColor(0, 0, 0, 255)
  97.                         surface.DrawTexturedRect(90, 105 , 16, 16) 
  98.             end
  99.         end
  100.                    
  101.     elseif not Prc.Configurations and Prc.Borders then
  102.         draw.RoundedBox( 0, -135, -145, 275, 10, Color(0,0,0,100))
  103.         draw.RoundedBox( 0, -135, -80, 275, 10, Color(0,0,0,100))
  104.         draw.RoundedBox( 0, -135, 50, 275, 10, Color(0,0,0,100))
  105.         draw.RoundedBox( 0, -135, 50, 275, 10, Color(0,0,0,100))
  106.         draw.RoundedBox( 0, -135, 125, 275, 10, Color(0,0,0,100))
  107.         draw.RoundedBox( 0, -135, -135, 10, 55, Color(0,0,0,100))
  108.         draw.RoundedBox( 0, 130, -135, 10, 55, Color(0,0,0,100))
  109.         draw.RoundedBox( 0, -135, 60, 10, 65, Color(0,0,0,100))
  110.         draw.RoundedBox( 0, 130, 60, 10, 65, Color(0,0,0,100))
  111.     end
  112.  
  113.     cam.End3D2D()
  114. end
  115.  
  116. function ENT:Think()
  117.  
  118.     if self:GetGlowInt() == 1 then
  119.         local enttable = {}
  120.         table.insert(enttable, self)
  121.         effects.halo.Add(enttable, Prc.PrinterGlow6, 2, 2, 1)
  122.     end
  123.    
  124.     if self:GetGlowInt() == 2 then
  125.         local enttable = {}
  126.         table.insert(enttable, self)
  127.         effects.halo.Add(enttable, Prc.PrinterGlow6, 2, 2, 1)
  128.     end
  129.  
  130. end
  131.  
  132. hook.Add("PreDrawHalos", "AddHalos", function()
  133.    
  134. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement