Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. local ScoreFrame
  2.  
  3.  
  4.  
  5.  
  6. function ScoreboardShow()
  7. if !IsValid(ScoreFrame) then
  8. ScoreFrame = vgui.Create( "DFrame" )
  9. ScoreFrame:SetSize(1100, 700)
  10. ScoreFrame:Center()
  11. ScoreFrame:SetDraggable(false)
  12. ScoreFrame:SetTitle("")
  13. ScoreFrame:ShowCloseButton(false)
  14.  
  15.  
  16. ScoreFrame.Paint = function( self, w, h )
  17. draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 150 ) )
  18. draw.RoundedBox( 0, 0, 30, w, 2, Color( 0, 0, 0, 200) )
  19. draw.RoundedBox( 0, 0, 0, w, 30, Color( 0, 0, 0, 175 ) )
  20. draw.SimpleText("Berger's Scoreboard", "Trebuchet24", 0, 0, Color( 255, 255, 255, 255 ) )
  21. draw.SimpleText(os.date("%H:%M:%S - %d/%m/%Y"), "Trebuchet24", 900, 0, Color( 255, 255, 255, 255 ) )
  22. end
  23.  
  24.  
  25. local Skill1 = vgui.Create("DLabel",ScoreFrame)
  26. Skill1:SetPos( 90, 40 )
  27. Skill1:SetText( "Name" )
  28. Skill1:SetFont( "Trebuchet" )
  29.  
  30. local Skill2 = vgui.Create("DLabel",ScoreFrame)
  31. Skill2:SetPos( 300, 40 )
  32. Skill2:SetText( "Job" )
  33. Skill2:SetFont( "Trebuchet18" )
  34.  
  35. local Skill3 = vgui.Create("DLabel",ScoreFrame)
  36. Skill3:SetPos( 550, 40 )
  37. Skill3:SetText( "Kills" )
  38. Skill3:SetFont( "Trebuchet18" )
  39.  
  40. local Skill4 = vgui.Create("DLabel",ScoreFrame)
  41. Skill4:SetPos( 650, 40 )
  42. Skill4:SetText( "Deaths" )
  43. Skill4:SetFont( "Trebuchet18" )
  44.  
  45. local Skill5 = vgui.Create("DLabel",ScoreFrame)
  46. Skill5:SetPos( 900, 40 )
  47. Skill5:SetText( "Ping" )
  48. Skill5:SetFont( "Trebuchet18" )
  49.  
  50. local Skill6 = vgui.Create("DLabel",ScoreFrame)
  51. Skill6:SetPos( 1000, 40 )
  52. Skill6:SetText( "Rank" )
  53. Skill6:SetFont( "Trebuchet18" )
  54.  
  55. local Skill7 = vgui.Create("DLabel",ScoreFrame)
  56. Skill7:SetPos( 750, 40 )
  57. Skill7:SetText( "Playtime" )
  58. Skill7:SetFont( "Trebuchet18" )
  59.  
  60.  
  61. local ScoreScroll = vgui.Create( "DScrollPanel", ScoreFrame )
  62. ScoreScroll:Dock( FILL )
  63.  
  64.  
  65. local scrollbar = ScoreScroll:GetVBar()
  66. function scrollbar:Paint( w, h )
  67. draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 150 ) )
  68. end
  69.  
  70. function scrollbar.btnUp:Paint( w, h )
  71. draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255 ) )
  72. end
  73.  
  74. function scrollbar.btnDown:Paint( w, h )
  75. draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255, 255 ) )
  76. end
  77.  
  78. function scrollbar.btnGrip:Paint( w, h )
  79. draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255, 130 ) )
  80. end
  81.  
  82.  
  83.  
  84. ScoreLayout = vgui.Create( "DListLayout", ScoreScroll )
  85. ScoreLayout:SetSize(ScoreFrame:GetWide()-10,ScoreScroll:GetTall())
  86. ScoreLayout:SetPos(0,50)
  87.  
  88.  
  89.  
  90.  
  91.  
  92. end
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. if IsValid(ScoreFrame) then
  101. ScoreLayout:Clear()
  102. for k,v in pairs(player.GetAll()) do
  103. PlayerList1 = vgui.Create("Button",ScoreLayout)
  104. PlayerList1:SetSize(ScoreLayout:GetWide(), 40)
  105. PlayerList1:SetPos(0,0)
  106. PlayerList1:SetText("")
  107. PlayerList1.Paint = function( self, w, h )
  108.  
  109.  
  110. draw.RoundedBox( 0, 0, 0, w, 36, team.GetColor(v:Team() ) )
  111.  
  112. if !v:Alive() then return draw.SimpleText("PLAYER IS DEATH", "Trebuchet24", 500, 0, Color( 255, 255, 255, 255 ) ) end
  113.  
  114. draw.SimpleText(v:Name(), "Trebuchet24", 60, 0, Color( 255, 255, 255, 255 ) )
  115. draw.SimpleText(team.GetName(v:Team()), "Trebuchet24", 300, 0, Color( 255, 255, 255, 255 ) )
  116. draw.SimpleText(v:Frags(), "Trebuchet24", 550, 0, Color( 255, 255, 255, 255 ) )
  117. draw.SimpleText(v:Deaths(), "Trebuchet24", 650, 0, Color( 255, 255, 255, 255 ) )
  118. draw.SimpleText(v:Ping(), "Trebuchet24", 900, 0, Color( 255, 255, 255, 255 ) )
  119. draw.SimpleText(v:GetNWInt( "TotalUTime" ).." hours", "Trebuchet24", 750, 0, Color( 255, 255, 255, 255 ) )
  120. draw.SimpleText(v:GetNWString("usergroup"), "Trebuchet24", 950, 0, Color( 255, 255, 255, 255 ) )
  121. end
  122.  
  123. PlayerList1.DoClick = function( )
  124. local ScoreMenu = DermaMenu()
  125. ScoreMenu:AddOption( "Spectate", function() RunConsoleCommand("ulx","spectate", v:Nick()) end )
  126. local ScoreMenuOption = ScoreMenu:AddSubMenu( "Teleportation" )
  127. ScoreMenuOption:AddOption( "Teleport", function() RunConsoleCommand("ulx","teleport", v:Nick()) end )
  128. ScoreMenuOption:AddOption( "Goto", function() RunConsoleCommand("ulx","goto", v:Nick()) end )
  129. local ScoreMenuOption = ScoreMenu:AddSubMenu( "Freeze/Unfreeze" )
  130. ScoreMenuOption:AddOption( "Freeze", function() RunConsoleCommand("ulx","freeze", v:Nick()) end)
  131. ScoreMenuOption:AddOption( "Unfreeze", function() RunConsoleCommand("ulx","unfreeze", v:Nick()) end)
  132. ScoreMenu:Open( gui.MouseX(), gui.MouseY())
  133. end
  134.  
  135.  
  136. local ScoreAvatar = vgui.Create( "AvatarImage", PlayerList1 )
  137. ScoreAvatar:SetSize( 30, 30 )
  138. ScoreAvatar:SetPos( 4, 3 )
  139. ScoreAvatar:SetPlayer( v, 64 )
  140.  
  141.  
  142.  
  143.  
  144.  
  145. end
  146. ScoreFrame:Show()
  147. ScoreFrame:MakePopup()
  148. ScoreFrame:SetKeyboardInputEnabled(true)
  149.  
  150. for k,v in pairs(player.GetAll()) do
  151.  
  152. table1 = {team.GetPlayers(v:Team())}
  153.  
  154. table.SortByMember( table1, "Name" )
  155.  
  156.  
  157. end
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164. end
  165.  
  166.  
  167.  
  168. end
  169. hook.Add( "ScoreboardShow", "ScoreboardShow", ScoreboardShow )
  170.  
  171.  
  172. function ScoreboardHide()
  173. if IsValid(ScoreFrame) then
  174. ScoreFrame:Hide()
  175. end
  176. end
  177. hook.Add( "ScoreboardHide", "dwadwawda", ScoreboardHide )
  178.  
  179. hook.Add( "ScoreboardShow", "Idk", function()
  180. return false
  181. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement