Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. include('shared.lua')
  2. local have_job = false
  3. // FONT //
  4.  
  5.  
  6. local full = nil
  7. local box = nil
  8. local content = nil
  9. local working = nil
  10. local target_mail = nil
  11. local owner = nil
  12. surface.CreateFont( "BigFont", {
  13. font = "Arial",
  14. extended = false,
  15. size = 30,
  16. weight = 500,
  17. blursize = 0,
  18. scanlines = 0,
  19. antialias = true,
  20. underline = false,
  21. italic = false,
  22. strikeout = false,
  23. symbol = false,
  24. rotary = false,
  25. shadow = false,
  26. additive = false,
  27. outline = false,
  28. } )
  29.  
  30. function relais_panel()
  31.  
  32. net.Start( "relais_info" )
  33. net.SendToServer()
  34.  
  35. net.Receive( "relais_info", function( len, ply )
  36.  
  37. if(!net.ReadBool()) then
  38.  
  39.  
  40. local Panel = vgui.Create( "DFrame" )
  41. Panel:SetSize( 200, 80 )
  42. Panel:Center()
  43. Panel:MakePopup()
  44.  
  45. local DLabel = vgui.Create( "DLabel", Panel )
  46. DLabel:SetSize( 190, 10 )
  47. DLabel:SetPos( 5, 40 )
  48. DLabel:SetText( "Pas de paquet dans le relais !" )
  49. DLabel.Paint = function( self, w, h )
  50. draw.RoundedBox( 0, 0, 0, w, h, Color( 25, 25, 25 ) )
  51. end
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. else
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. local Frame2 = vgui.Create( "DFrame" )
  70. Frame2:SetTitle( "Point de relais" )
  71. Frame2:SetSize( 200, 80 )
  72. Frame2:Center()
  73. Frame2:MakePopup()
  74. Frame2.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
  75. draw.RoundedBox( 0, 0, 0, w, h, Color( 25, 25, 25 ) ) -- Draw a red box instead of the frame
  76. end
  77.  
  78. ---------
  79.  
  80.  
  81.  
  82. local ButtonE = vgui.Create( "DButton", Frame2 )
  83. ButtonE:SetText( "Récupérer le colis" )
  84. ButtonE:SetTextColor( Color( 255, 255, 255 ) )
  85. ButtonE:SetPos( 50, 30 )
  86. ButtonE:SetSize( 100, 30 )
  87. ButtonE.Paint = function( self, w, h )
  88. draw.RoundedBox( 0, 0, 0, w, h, Color( 32, 31, 32 ) ) -- Draw a blue button
  89. end
  90.  
  91. ButtonE.DoClick = function()
  92. net.Start( "take_package_relais" )
  93. net.WriteEntity(box)
  94. net.SendToServer()
  95. if IsValid(Frame2) then Frame2:Remove() end
  96.  
  97. working = true
  98. end
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110. end
  111.  
  112.  
  113.  
  114. end )
  115.  
  116.  
  117. end
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. usermessage.Hook("relais_panel", relais_panel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement