Advertisement
Guest User

Derma

a guest
Jan 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.20 KB | None | 0 0
  1. function mGeneral()
  2.     if (!IsValid(dGeneral)) then
  3.         dGeneral = vgui.Create("DFrame")
  4.        
  5.         dGeneral:SetSize(400, 500)
  6.         dGeneral:Center()
  7.         dGeneral:SetTitle("General Manual")
  8.         dGeneral:SetVisible(true)
  9.         dGeneral:SetDraggable(false)
  10.         --dGeneral:ShowCloseButton(false)
  11.         dGeneral:MakePopup()
  12.        
  13.         local lTitle = vgui.Create("DLabel", dGeneral)
  14.         lTitle:SetPos(150, 50)
  15.         lTitle:SetSize(100, 45)
  16.         lTitle:SetText("General Manual")
  17.        
  18.         hook.Add("KeyRelease", "krGeneral", function(ply, key)
  19.             if (key == IN_USE) then
  20.                 dGeneral:Close()
  21.                 print("general")
  22.             end
  23.         end)
  24.     end
  25. end
  26.  
  27. function mCar()
  28.     if (!IsValid(dCar)) then
  29.         dCar = vgui.Create("DFrame")
  30.        
  31.         dCar:SetSize(400, 500)
  32.         dCar:Center()
  33.         dCar:SetTitle("General Manual")
  34.         dCar:SetVisible(true)
  35.         dCar:SetDraggable(false)
  36.         --dCar:ShowCloseButton(false)
  37.         dCar:MakePopup()
  38.        
  39.         local lTitle = vgui.Create("DLabel", dCar)
  40.         lTitle:SetPos(150, 50)
  41.         lTitle:SetSize(100, 45)
  42.         lTitle:SetText("General Manual")
  43.        
  44.         hook.Add("KeyRelease", "krGeneral", function(ply, key)
  45.             if (key == IN_USE) then
  46.                 dCar:Close()
  47.                 print("car")
  48.             end
  49.         end)
  50.     end
  51. end
  52.  
  53. function mManual()
  54.     if (!IsValid(dManual)) then
  55.         dManual = vgui.Create("DFrame")
  56.            
  57.         dManual:SetSize(400, 500)
  58.         dManual:Center()
  59.         dManual:SetTitle("Manual")
  60.         dManual:SetVisible(true)
  61.         dManual:SetDraggable(false)
  62.         --dManual:ShowCloseButton(false)
  63.         dManual:MakePopup()
  64.        
  65.         local lTitle = vgui.Create("DLabel", dManual)
  66.         lTitle:SetPos(150, 50)
  67.         lTitle:SetSize(100, 45)
  68.         lTitle:SetText("All Purpose Manual")
  69.        
  70.         local bGeneral = vgui.Create("DButton", dManual)
  71.         bGeneral:SetPos(150, 150)
  72.         bGeneral:SetSize(100, 45)
  73.         bGeneral:SetText("General Manual")
  74.         bGeneral.DoClick = mGeneral
  75.        
  76.         local bCar = vgui.Create("DButton", dManual)
  77.         bCar:SetPos(150, 200)
  78.         bCar:SetSize(100, 45)
  79.         bCar:SetText("Car Manual")
  80.         bCar.DoClick = mCar
  81.        
  82.         hook.Add("KeyRelease", "krManual", function(ply, key)
  83.             if (key == IN_USE) then
  84.                 dManual:Close()
  85.             end
  86.         end)
  87.     end
  88. end
  89.  
  90. function mMain()
  91.     hook.Add("KeyPress", "kpAllManual", function(ply, key)
  92.         if (ply:KeyDown(IN_USE)) then
  93.             mManual()
  94.         end
  95.     end)
  96. end
  97.  
  98. hook.Add("Think", "tMain", mMain)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement