Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.57 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. Casier = Casier or {}
  4. Casier.Warn = {}
  5.  
  6. surface.CreateFont( "Casier:AWarn:Font:Arial:30",
  7. {
  8. font = "Arial",
  9. size = 35,
  10. weight = 560,
  11. })
  12.  
  13. local function DropMoney()
  14. local Base = vgui.Create( "DFrame" )
  15. Base:SetSize( 350, 145 )
  16. Base:Center()
  17. Base:SetTitle( "" )
  18. Base:SetDraggable( true )
  19. Base:ShowCloseButton( true )
  20. Base:MakePopup()
  21. function Base:Paint( w, h )
  22. draw.RoundedBox( 6, 0, 20, w, h, Color( 234, 0, 0,255 ) )
  23. draw.RoundedBox( 6, 0, 0, w, h, Color( 40, 40, 40,255 ) )
  24.  
  25. draw.SimpleText( "Montant : ", "Trebuchet24", w / 2, 25, color_white, 1 )
  26. end
  27.  
  28. local pAmount = vgui.Create( "DTextEntry", Base )
  29. pAmount:SetSize( Base:GetWide() - 10, 25 )
  30. pAmount:SetPos( 5, 60 )
  31. pAmount:SetNumeric( true )
  32. pAmount:SetPlaceholderText( 'Entrez un montant...' )
  33.  
  34. local btn = vgui.Create( "DButton", Base )
  35. btn:SetSize( 100, 30 )
  36. btn:SetPos( Base:GetWide() / 2 - btn:GetWide() / 2, 100 )
  37. btn:SetText( "Valider" )
  38. btn:SetTextColor( color_white )
  39. btn:SetFont( 'Trebuchet24' )
  40. function btn:Paint( w, h )
  41. draw.RoundedBox( 17, 0, 0, w, h, Color( 10, 130, 255, 255 ) )
  42. end
  43. function btn:DoClick()
  44. if pAmount:GetValue() != "" && tonumber( pAmount:GetValue() ) > 0 then
  45. RunConsoleCommand( "say", "/dropmoney " .. tonumber( pAmount:GetValue() ) )
  46. end
  47.  
  48. Base:Remove()
  49. end
  50. end
  51.  
  52. function Casier.Warn:OpenMenu()
  53. local tblBtns = {
  54. [1] = {Name = "StopSound", Color = Color( 234, 0, 0 ), Func = function() LocalPlayer():ConCommand( "stopsound" ) end },
  55. [2] = {Name = "Se mettre en 3ème personne", Color = Color( 234, 0, 0 ), Func = function() Thirdperson() end },
  56. [3] = {Name = "Poser votre arme à terre", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "/drop" ) end },
  57. [4] = {Name = "Poser votre argent à terre", Color = Color( 234, 0, 0 ), Func = function() DropMoney() end },
  58. [5] = {Name = "Règlement du serveur", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!règlementserveur" ) end },
  59. [6] = {Name = "Appeller un admin", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "///" ) end },
  60. [7] = {Name = "Mode Admin", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!staff" ) end },
  61. [8] = {Name = "Désactiver Mode Admin", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!unstaff" ) end },
  62. [9] = {Name = "Casier Administratif", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!warnings" ) end },
  63. [10] = {Name = "Logs", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!blogs" ) end },
  64. [11] = {Name = "Notre Workshop", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!workshop" ) end },
  65. [12] = {Name = "Notre Discord", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!discord" ) end },
  66. [13] = {Name = "Notre Groupe Steam", Color = Color( 234, 0, 0 ), Func = function() RunConsoleCommand( "say", "!discord" ) end },
  67. [14] = {Name = "Se déconnecter", Color = Color( 234, 0, 0 ), Func = function() LocalPlayer():ConCommand( "disconnect" ) end },
  68. }
  69.  
  70. local Base = vgui.Create( "DFrame" )
  71. Base:SetSize( 425, 1100)
  72. Base:SetPos( 1496, 0)
  73. Base:SetTitle( "" )
  74. Base:SetDraggable( false )
  75. Base:ShowCloseButton( true )
  76. Base:MakePopup()
  77.  
  78. function Base:Paint( w, h )
  79. draw.RoundedBox( 0, 0, 0, w, h, Color( 234, 0, 0,255 ) )
  80. draw.RoundedBox( 0, 7, 0, w, h, Color( 40, 40, 40,255 ) )
  81. draw.SimpleText( "", "Casier:AWarn:Font:Arial:30", 60, 46, color_black )
  82. end
  83.  
  84. local logo = vgui.Create( "DImage", Base )
  85. logo:SetPos( 900, 0 )
  86. logo:SetSize( 150, 150 )
  87. logo:SetImage( "materials/custom/key.png" )
  88.  
  89. Casier.Warn.Menu = Base
  90.  
  91. local pList = vgui.Create( "DScrollPanel", Base )
  92. pList:SetSize( Base:GetWide() - 15, Base:GetTall() - 50 )
  93. pList:SetPos( 10, 200 )
  94.  
  95. for k,v in SortedPairs( tblBtns or {} ) do
  96. local btn = vgui.Create( "DButton", pList )
  97. btn:SetSize( pList:GetWide(), 25 )
  98. btn:Dock( TOP )
  99. btn:DockMargin( 0, 5, 0, 0 )
  100. btn:SetText( v['Name'] )
  101. btn:SetTextColor( color_white )
  102. btn:SetFont( 'Trebuchet24' )
  103. function btn:Paint( w, h )
  104. draw.RoundedBox( 0, 0, 0, w, h, v['Color'] )
  105. end
  106. function btn:DoClick()
  107. v['Func']()
  108. end
  109. end
  110. end
  111.  
  112. hook.Add( "OnContextMenuOpen", "Casier:Warn:ContextMenuOpen", function()
  113. Casier.Warn:OpenMenu()
  114. end)
  115.  
  116. hook.Add( "OnContextMenuClose", "Casier:Warn:ContextMenuClose", function()
  117. if IsValid( Casier.Warn.Menu ) then Casier.Warn.Menu:Remove()
  118. logo:Remove() end
  119. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement