Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include('shared.lua')
- local have_job = false
- // FONT //
- local full = nil
- local box = nil
- local content = nil
- local working = nil
- local target_mail = nil
- local owner = nil
- surface.CreateFont( "BigFont", {
- font = "Arial",
- extended = false,
- size = 30,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- function relais_panel()
- net.Start( "relais_info" )
- net.SendToServer()
- net.Receive( "relais_info", function( len, ply )
- if(!net.ReadBool()) then
- local Panel = vgui.Create( "DFrame" )
- Panel:SetSize( 200, 80 )
- Panel:Center()
- Panel:MakePopup()
- local DLabel = vgui.Create( "DLabel", Panel )
- DLabel:SetSize( 190, 10 )
- DLabel:SetPos( 5, 40 )
- DLabel:SetText( "Pas de paquet dans le relais !" )
- DLabel.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 25, 25, 25 ) )
- end
- else
- local Frame2 = vgui.Create( "DFrame" )
- Frame2:SetTitle( "Point de relais" )
- Frame2:SetSize( 200, 80 )
- Frame2:Center()
- Frame2:MakePopup()
- Frame2.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
- draw.RoundedBox( 0, 0, 0, w, h, Color( 25, 25, 25 ) ) -- Draw a red box instead of the frame
- end
- ---------
- local ButtonE = vgui.Create( "DButton", Frame2 )
- ButtonE:SetText( "Récupérer le colis" )
- ButtonE:SetTextColor( Color( 255, 255, 255 ) )
- ButtonE:SetPos( 50, 30 )
- ButtonE:SetSize( 100, 30 )
- ButtonE.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 32, 31, 32 ) ) -- Draw a blue button
- end
- ButtonE.DoClick = function()
- net.Start( "take_package_relais" )
- net.WriteEntity(box)
- net.SendToServer()
- if IsValid(Frame2) then Frame2:Remove() end
- working = true
- end
- end
- end )
- end
- usermessage.Hook("relais_panel", relais_panel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement