SHARE
TWEET

Untitled

a guest Oct 13th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  function showDesc(entreprises)
  2.  
  3.  
  4.         if !IsValid(FrameTransaction) then return end
  5.         if IsValid(FrameTransaction.Panel.Nomlabel) then FrameTransaction.Panel.Nomlabel:Remove() end
  6.         if IsValid(FrameTransaction.Panel.DescriptionLabel) then FrameTransaction.Panel.DescriptionLabel:Remove() end
  7.         if IsValid(FrameTransaction.Panel.DangerLabel) then FrameTransaction.Panel.DangerLabel:Remove() end
  8.         if IsValid(FrameTransaction.Panel.SommeEntry) then FrameTransaction.Panel.SommeEntry:Remove() end
  9.         if IsValid(FrameTransaction.Panel.BlanchirBouton) then FrameTransaction.Panel.BlanchirBouton:Remove() end
  10.  
  11.  
  12.  
  13.         FrameTransaction.Panel = vgui.Create( "DPanel", FrameTransaction )
  14.         FrameTransaction.Panel:SetPos(260, 100)
  15.         FrameTransaction.Panel:SetSize(400, 250)
  16.         function FrameTransaction.Panel:Paint(w, h)
  17.  
  18.             draw.RoundedBox(5, 0, 0, w, h, Color(64, 64, 64, 50))
  19.  
  20.         end
  21.  
  22.  
  23.         FrameTransaction.Panel.Nomlabel = vgui.Create( "DLabel", FrameTransaction.Panel )
  24.         surface.SetFont("DermaDefault")
  25.         local  wtn, htn = surface.GetTextSize(entreprises.Name)
  26.         FrameTransaction.Panel.Nomlabel:SetPos( 150 - wtn/2, 50 )
  27.         FrameTransaction.Panel.Nomlabel:SetSize(250, 25)
  28.         FrameTransaction.Panel.Nomlabel:SetText( "" )
  29.  
  30.         function FrameTransaction.Panel.Nomlabel:Paint(w, h)
  31.  
  32.  
  33.             draw.SimpleText( entreprises.Name, "DermaDefault", 0 , 0 , Color( 191, 191, 191,255 ))
  34.  
  35.         end
  36.  
  37.         FrameTransaction.Panel.DescriptionLabel = vgui.Create( "DLabel", FrameTransaction.Panel )
  38.         surface.SetFont("DermaDefault")
  39.         local  wt, ht = surface.GetTextSize(entreprises.Description)
  40.         FrameTransaction.Panel.DescriptionLabel:SetPos( 200 - wt/2, 75 )
  41.         FrameTransaction.Panel.DescriptionLabel:SetContentAlignment(5)
  42.         FrameTransaction.Panel.DescriptionLabel:SetText( "" )
  43.         function FrameTransaction.Panel.DescriptionLabel:Paint(w, h)
  44.             draw.SimpleText( entreprises.Description, "DermaDefault", 0 , 0 , Color( 191, 191, 191,255 ))
  45.         end
  46.  
  47.         FrameTransaction.Panel.DangerLabel = vgui.Create( "DLabel", FrameTransaction.Panel )
  48.         surface.SetFont("DermaDefault")
  49.         local  wt, ht = surface.GetTextSize("Danger : " .. entreprises.Danger)
  50.         FrameTransaction.Panel.DangerLabel:SetPos( 200 - wt/2, 100 )
  51.         FrameTransaction.Panel.DescriptionLabel:SetSize(250, 50)
  52.         FrameTransaction.Panel.DangerLabel:SetText("")
  53.         function FrameTransaction.Panel.DangerLabel:Paint(w, h)
  54.  
  55.             draw.SimpleText( "Danger : " .. entreprises.Danger, "DermaDefault", 0,0 , Color(191, 191, 191,255 ))
  56.  
  57.         end
  58.  
  59.         FrameTransaction.Panel.SommeEntry = vgui.Create( "DTextEntry", FrameTransaction.Panel )
  60.         FrameTransaction.Panel.SommeEntry:SetSize( 200, 30 )
  61.         FrameTransaction.Panel.SommeEntry:SetPos( 200 - 200/2, 150)
  62.         FrameTransaction.Panel.SommeEntry:SetNumeric(true)
  63.         FrameTransaction.Panel.SommeEntry:SetPlaceholderText( "Veuillez entrez un montant." )
  64.  
  65.         FrameTransaction.Panel.BlanchirBouton = vgui.Create("DButton", FrameTransaction.Panel)
  66.         FrameTransaction.Panel.BlanchirBouton:SetPos(200 - 75, 225)
  67.         FrameTransaction.Panel.BlanchirBouton:SetSize(150, 50)
  68.         FrameTransaction.Panel.BlanchirBouton:SetText("")
  69.         function FrameTransaction.Panel.BlanchirBouton:Paint(w, h)
  70.  
  71.  
  72.             if FrameTransaction.Panel.BlanchirBouton:IsHovered() then
  73.                 draw.RoundedBox(5, 0, 0, 250, 50, Color(191, 191, 191, 255))
  74.             else
  75.                 draw.RoundedBox(5, 0, 0, 250, 50, Color(0, 191, 191, 255))
  76.             end
  77.  
  78.  
  79.             surface.SetFont("DermaDefault")
  80.             local  wt, ht = surface.GetTextSize("Blanchir")
  81.             draw.SimpleText( "Blanchir", "DermaDefault", w /2 - wt/2, h /2 - ht / 2 , Color( 0, 0, 0,255 ))
  82.         end
  83.  
  84.         function FrameTransaction.Panel.BlanchirBouton:DoClick()
  85.  
  86.             local montant = FrameTransaction.Panel.SommeEntry:GetInt()
  87.  
  88.             net.Start("CRP:Blanchisserie:Blanchir")
  89.                 net.WriteInt(montant, 32)
  90.                 net.WriteInt(entreprises.Danger, 32)
  91.                 net.WriteString(entreprises.Name)
  92.             net.SendToServer()
  93.  
  94.             FrameTransaction.Panel:Remove()
  95.             FrameTransaction:Remove()
  96.            
  97.         end
  98.  
  99.  
  100.     end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top