daily pastebin goal
63%
SHARE
TWEET

heracles

a guest Jan 25th, 2016 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddScoreboardButton(1, {
  2.     ButtonName = "Help",
  3.     Icon = "materials/niandralades/minigames/help.png",
  4.     Function = function()
  5.         Minigames:OpenHelpMenu()
  6.     end
  7. })
  8.  
  9. AddScoreboardButton(2, {
  10.     ButtonName = "RTV",
  11.     Icon = "materials/niandralades/minigames/exit.png",
  12.     Function = function()
  13.         Minigames:RequestRTVFromClient()
  14.     end
  15. })
  16.  
  17. AddScoreboardButton(3, {
  18.     ButtonName = "Model",
  19.     Icon = "materials/niandralades/minigames/model.png",
  20.     Function = function()
  21.         Minigames:PlayerModel()
  22.     end
  23. })
  24.  
  25. AddScoreboardButton(4, {
  26.     ButtonName = "Team",
  27.     Icon = "materials/niandralades/minigames/teams.png",
  28.     Function = function()
  29.         Minigames:SelectTeams()
  30.     end
  31. })
  32.  
  33.  
  34. AddScoreboardButton(5, {
  35.     ButtonName = "Pointshop",
  36.     Icon = "materials/niandralades/minigames/cash.png",
  37.     Function = "http://www.google.co.uk"
  38. })
  39.  
  40.  
  41. AddScoreboardButton(6, {
  42.     ButtonName = "Group",
  43.     Icon = "materials/niandralades/minigames/community.png",
  44.     Function = "http://www.google.co.uk"
  45. })
  46.  
  47. AddScoreboardButton(7, {
  48.     ButtonName = "Donate",
  49.     Icon = "materials/niandralades/minigames/donate.png",
  50.     Function = "http://www.google.co.uk"
  51. })
  52.  
  53.  
  54. function GM:ScoreboardShow()
  55.     if Minigames.DefaultScoreboard then
  56.         Minigames:ShowScoreboard()
  57.         if LocalPlayer():Alive() then
  58.             Minigames:ToggleAvatar(false)
  59.         end
  60.     end
  61. end
  62.  
  63. function GM:ScoreboardHide()
  64.     if Minigames.DefaultScoreboard then
  65.         Minigames:HideScoreboard()
  66.         if LocalPlayer():Alive() then
  67.             Minigames:ToggleAvatar(true)
  68.         end
  69.         gui.EnableScreenClicker(false)
  70.     end
  71. end
  72.  
  73. function Ply(name)
  74.     name = string.lower(name);
  75.     for _,v in ipairs(player.GetHumans()) do
  76.         if(string.find(string.lower(v:Name()),name,1,true) != nil)
  77.             then return v;
  78.         end
  79.     end
  80. end
  81.  
  82. Minigames.ScoreboardOpen = false
  83. function Minigames:ShowScoreboard()
  84.  
  85.     Minigames.ScoreboardOpen = true
  86.  
  87.     local spacing = 20
  88.     local frame = vgui.Create("DFrame")
  89.     frame:SetSize(820,ScrH()-100)
  90.     frame:Center()
  91.     frame:ShowCloseButton(false)
  92.     frame:SetTitle("")
  93.     frame.Paint = function()
  94.     end
  95.     frame.Think = function()
  96.         gui.EnableScreenClicker(true)
  97.     end
  98.    
  99.     local host_dpanel = vgui.Create("DPanel", frame)
  100.     host_dpanel:SetSize(frame:GetWide(),50)
  101.     host_dpanel:SetPos(0,0)
  102.     host_dpanel.Paint = function()
  103.         draw.RoundedBox(0,0,0,host_dpanel:GetWide(),host_dpanel:GetTall(),Color(0,0,0,100))
  104.         draw.DrawText(GetHostName(), "NexaLight35",host_dpanel:GetWide()/2,5, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  105.     end
  106.    
  107.     local maths = Minigames.RoundLimit-Minigames.RoundNumber
  108.     local misc_info_dpanel = vgui.Create("DPanel", frame)
  109.     misc_info_dpanel:SetSize(frame:GetWide(),50)
  110.     misc_info_dpanel:SetPos(0,frame:GetTall()-misc_info_dpanel:GetTall())
  111.     misc_info_dpanel.Paint = function()
  112.         draw.RoundedBox(0,0,0,host_dpanel:GetWide(),host_dpanel:GetTall(),Color(0,0,0,100))
  113.         draw.DrawText(game.GetMap() .. " | " .. GetGlobalString("Minigames_CurrentGamemode") .. " | " .. maths .. " round(s) left", "NexaLight35",misc_info_dpanel:GetWide()/2,7, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  114.     end
  115.    
  116.     local ply_info = vgui.Create("DPanel", frame)
  117.     ply_info:SetSize(64+64+15, 74)
  118.     ply_info:SetPos(0,frame:GetTall()-spacing-misc_info_dpanel:GetTall()-ply_info:GetTall())
  119.     ply_info.Paint = function()
  120.         draw.RoundedBox(0,0,0,ply_info:GetWide(),ply_info:GetTall(),Color(49,49,49,150))
  121.     end
  122.    
  123.     local buttons_panel = vgui.Create("DPanel", frame)
  124.     buttons_panel:SetSize(frame:GetWide(), 74)
  125.     buttons_panel:SetPos(ply_info:GetWide(),frame:GetTall()-spacing-misc_info_dpanel:GetTall()-buttons_panel:GetTall())
  126.     buttons_panel.Paint = function()
  127.         draw.RoundedBox(0,0,0,buttons_panel:GetWide(),buttons_panel:GetTall(),Color(0,0,0,100))
  128.         draw.RoundedBox(0,0,2,2,buttons_panel:GetTall()-4,Color(255,255,255,150))
  129.     end
  130.    
  131.     local num = 0
  132.     for k, v in pairs(Minigames.SBT) do
  133.         local custom_buttons = vgui.Create("DButton", buttons_panel)
  134.         custom_buttons:SetPos(7+num*69,5)
  135.         custom_buttons:SetSize(64,64)
  136.         custom_buttons:SetText("")
  137.         custom_buttons.Paint = function()
  138.             draw.RoundedBox(0,0,0,custom_buttons:GetWide(),custom_buttons:GetTall(),Color(70,154,180,150))
  139.             draw.DrawText(v.ButtonName, "NexaLight15",custom_buttons:GetWide()/2,custom_buttons:GetTall()-20, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  140.         end
  141.         custom_buttons.DoClick = function()
  142.             if isstring(v.Function) then
  143.                 gui.OpenURL(v.Function)
  144.                
  145.             else
  146.                 v.Function()
  147.             end
  148.         end
  149.        
  150.         local custom_icons = vgui.Create("DImage", custom_buttons)
  151.         custom_icons:SetSize(32,32)
  152.         custom_icons:SetImage(v.Icon)
  153.         custom_icons:SetPos(custom_buttons:GetWide()/2-16,5)
  154.        
  155.         num = num + 1
  156.     end
  157.    
  158.     local space = #Minigames.SBT*64+5*#Minigames.SBT+7
  159.     local specnum = vgui.Create("DPanel", buttons_panel)
  160.     specnum:SetPos(space, 5)
  161.     specnum:SetSize(183, 64)
  162.     specnum.Paint = function()
  163.         draw.RoundedBox(0,0,0,specnum:GetWide(),specnum:GetTall(),Color(216,52,50,150))
  164.         draw.DrawText(#team.GetPlayers(TEAM_SPECTATOR), "NexaLight55",15,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  165.         draw.DrawText("Spectators", "NexaLight25",50,20, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  166.     end
  167.    
  168.    
  169.     local kills_pnl = vgui.Create("DPanel", ply_info)
  170.     kills_pnl:SetPos(5,5)
  171.     kills_pnl:SetSize(64,64)
  172.     kills_pnl.Paint = function()
  173.         draw.RoundedBox(0,0,0,kills_pnl:GetWide(),kills_pnl:GetTall(),Color(216,52,50,150))
  174.         draw.DrawText("Kills", "NexaLight15",kills_pnl:GetWide()/2,kills_pnl:GetTall()-20, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  175.         draw.DrawText(LocalPlayer():Frags(), "NexaLight40",kills_pnl:GetWide()/2,5, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  176.     end
  177.    
  178.     local deaths = vgui.Create("DPanel", ply_info)
  179.     deaths:SetPos(5+64+5,5)
  180.     deaths:SetSize(64,64)
  181.     deaths.Paint = function()
  182.         draw.RoundedBox(0,0,0,deaths:GetWide(),deaths:GetTall(),Color(216,52,50,150))
  183.         draw.DrawText("Deaths", "NexaLight15",deaths:GetWide()/2,deaths:GetTall()-20, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  184.         draw.DrawText(LocalPlayer():Deaths(), "NexaLight40",deaths:GetWide()/2,5, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  185.     end
  186.    
  187.     local height = frame:GetTall()-spacing-spacing-spacing-74-50-50-50
  188.  
  189.     function Minigames:TeamScoreboard()
  190.         -------[Team 2]---------
  191.         local team_2_header = vgui.Create("DPanel", frame)
  192.         team_2_header:SetSize(frame:GetWide()/2-spacing, 50)
  193.         team_2_header:SetPos(0,host_dpanel:GetTall()+spacing)
  194.         team_2_header.Paint = function()
  195.             draw.RoundedBox(0,0,0,team_2_header:GetWide(),team_2_header:GetTall(),Color(0,0,0,100))
  196.             draw.DrawText("Blue", "NexaLight35",5,10, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  197.             draw.DrawText(team.GetScore(2), "NexaLight40",team_2_header:GetWide()-5,7, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  198.         end
  199.            
  200.         local team_2_panel = vgui.Create("DPanel", frame)
  201.         team_2_panel:SetPos(0,host_dpanel:GetTall()+team_2_header:GetTall()+spacing)
  202.         team_2_panel:SetSize(team_2_header:GetWide(),26)
  203.         team_2_panel.Paint = function()
  204.             draw.RoundedBox(0,0,0,team_2_panel:GetWide(),team_2_panel:GetTall(),Color(65, 131, 215,150))
  205.             draw.DrawText("NAME", "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  206.             draw.DrawText("KILLS", "NexaLight20",team_2_panel:GetWide()/2-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  207.             draw.DrawText("DEATHS", "NexaLight20",team_2_panel:GetWide()/2+50,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  208.             draw.DrawText("PING", "NexaLight20",team_2_panel:GetWide()-20,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  209.             draw.RoundedBox(0,0,25,team_2_panel:GetWide(),1,Color(255,255,255,150))
  210.         end
  211.        
  212.         local team_2_scroll = vgui.Create("DScrollPanel", frame)
  213.         team_2_scroll:SetPos(0,host_dpanel:GetTall()+team_2_header:GetTall()+spacing+26)
  214.         team_2_scroll:SetSize(team_2_header:GetWide(),height-250)
  215.         team_2_scroll.Paint = function()
  216.             draw.RoundedBox(0,0,0,team_2_scroll:GetWide(),team_2_scroll:GetTall(),Color(1,155,223,150))
  217.         end
  218.  
  219.         local num = 0
  220.         for k, v in pairs(team.GetPlayers(2)) do
  221.             local nick_lbl = vgui.Create("DButton", team_2_scroll)
  222.             nick_lbl:SetText("")
  223.             nick_lbl:SizeToContents()
  224.             nick_lbl:SetSize(team_2_panel:GetWide(),30)
  225.             nick_lbl:SetPos(0,num*nick_lbl:GetTall())
  226.             nick_lbl.Paint = function()
  227.                 draw.DrawText(v:Nick(), "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  228.                 draw.DrawText(v:Frags(), "NexaLight20",team_2_panel:GetWide()/2-35,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  229.                 draw.DrawText(v:Deaths(), "NexaLight20",team_2_panel:GetWide()/2+50,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  230.                 draw.DrawText(v:Ping(), "NexaLight20",team_2_panel:GetWide()-45,5,Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  231.                
  232.                 if not v:Alive() then
  233.                     draw.RoundedBox(0,0,0,nick_lbl:GetWide(),nick_lbl:GetTall(),Color(210, 215, 211,150))
  234.                 end
  235.             end
  236.             num = num + 1
  237.             nick_lbl.DoClick = function()
  238.                 if LocalPlayer():IsUserGroup("trialadmin") or LocalPlayer():IsAdmin() then
  239.                     local parentMenu = DermaMenu()
  240.  
  241.                     local subMenu, parentMenuOption = parentMenu:AddSubMenu( "Change Player Team" )
  242.  
  243.                     --local blueOption = subMenu:AddOption( "Blue", function() v:ConCommand("set_team "..v:EntIndex().." 2") end )
  244.                     local redOption = subMenu:AddOption( "Red", function() v:ConCommand("set_team "..v:EntIndex().." 3") end )
  245.                     local spectatorOption = subMenu:AddOption( "Spectator", function() v:ConCommand("set_team "..v:EntIndex().." 1002") end )
  246.  
  247.                     parentMenu:Open()
  248.                 end
  249.             end
  250.         end
  251.         -------------------------
  252.        
  253.         -------[Team 3]---------
  254.         local team_3_header = vgui.Create("DPanel", frame)
  255.         team_3_header:SetSize(frame:GetWide()/2, 50)
  256.         team_3_header:SetPos(team_2_header:GetWide()+spacing,host_dpanel:GetTall()+spacing)
  257.         team_3_header.Paint = function()
  258.             draw.RoundedBox(0,0,0,team_3_header:GetWide(),team_3_header:GetTall(),Color(0,0,0,100))
  259.             draw.DrawText("Red", "NexaLight35",team_3_header:GetWide()-2-5,10, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  260.             draw.DrawText(team.GetScore(3), "NexaLight40",5,7, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  261.         end
  262.        
  263.         local team_3_panel = vgui.Create("DPanel", frame)
  264.         team_3_panel:SetPos(team_2_panel:GetWide()+spacing,host_dpanel:GetTall()+team_2_header:GetTall()+spacing)
  265.         team_3_panel:SetSize(team_2_header:GetWide()+spacing,26)
  266.         team_3_panel.Paint = function()
  267.             draw.RoundedBox(0,0,0,team_3_panel:GetWide(),team_3_panel:GetTall(),Color(223,32,1,150))
  268.             draw.DrawText("NAME", "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  269.             draw.DrawText("KILLS", "NexaLight20",team_3_panel:GetWide()/2-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  270.             draw.DrawText("DEATHS", "NexaLight20",team_3_panel:GetWide()/2+50,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  271.             draw.DrawText("PING", "NexaLight20",team_3_panel:GetWide()-20,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  272.             draw.RoundedBox(0,0,25,team_3_panel:GetWide(),1,Color(255,255,255,150))
  273.         end
  274.        
  275.         local team_3_scroll = vgui.Create("DScrollPanel", frame)
  276.         team_3_scroll:SetPos(team_2_panel:GetWide()+spacing,host_dpanel:GetTall()+team_2_header:GetTall()+spacing+26)
  277.         team_3_scroll:SetSize(team_3_panel:GetWide(),height-250)
  278.         team_3_scroll.Paint = function()
  279.             draw.RoundedBox(0,0,0,team_3_scroll:GetWide(),team_3_scroll:GetTall(),Color(216,52,50,150,150))
  280.         end
  281.        
  282.         local num = 0
  283.         for k, v in pairs(team.GetPlayers(3)) do
  284.             local nick_lbl = vgui.Create("DButton", team_3_scroll)
  285.             nick_lbl:SetText("")
  286.             nick_lbl:SizeToContents()
  287.             nick_lbl:SetSize(team_3_panel:GetWide(),30)
  288.             nick_lbl:SetPos(0,num*nick_lbl:GetTall())
  289.             nick_lbl.Paint = function()
  290.                 draw.DrawText(v:Nick(), "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  291.                 draw.DrawText(v:Frags(), "NexaLight20",team_3_panel:GetWide()/2-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  292.                 draw.DrawText(v:Deaths(), "NexaLight20",team_3_panel:GetWide()/2+45,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  293.                 draw.DrawText(v:Ping(), "NexaLight20",team_2_panel:GetWide()-18,5,Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  294.                
  295.                 if not v:Alive() then
  296.                     draw.RoundedBox(0,0,0,nick_lbl:GetWide(),nick_lbl:GetTall(),Color(210, 215, 211,150))
  297.                 end
  298.             end
  299.             num = num + 1
  300.             nick_lbl.DoClick = function()
  301.                 if LocalPlayer():IsUserGroup("trialadmin") or LocalPlayer():IsAdmin() then
  302.                     local parentMenu = DermaMenu()
  303.  
  304.                     local subMenu, parentMenuOption = parentMenu:AddSubMenu( "Change Player Team" )
  305.  
  306.                     local blueOption = subMenu:AddOption( "Blue", function() v:ConCommand("set_team "..v:EntIndex().." 2") end )
  307.                     --local redOption = subMenu:AddOption( "Red", function() v:ConCommand("set_team "..v:EntIndex().." 3") end )
  308.                     local spectatorOption = subMenu:AddOption( "Spectator", function() v:ConCommand("set_team "..v:EntIndex().." 1002") end )
  309.  
  310.                     parentMenu:Open()
  311.                 end
  312.             end
  313.         end
  314.         -------------------------
  315.        
  316.         -------[Team 1]---------
  317.         local team_1_header = vgui.Create("DPanel", frame)
  318.         team_1_header:SetSize(frame:GetWide(), 50)
  319.         team_1_header:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall())
  320.         team_1_header.Paint = function()
  321.             draw.RoundedBox(0,0,0,team_1_header:GetWide(),team_1_header:GetTall(),Color(0,0,0,100))
  322.             draw.DrawText("Spectators", "NexaLight35",5,10, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  323.         end
  324.    
  325.         local team_1_panel = vgui.Create("DPanel", frame)
  326.             team_1_panel:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall()+team_1_header:GetTall())
  327.             team_1_panel:SetSize(team_1_header:GetWide(),26)
  328.             team_1_panel.Paint = function()
  329.                 draw.RoundedBox(0,0,0,team_1_panel:GetWide(),team_1_panel:GetTall(),Color(119, 119, 119,150))
  330.                 draw.DrawText("NAME", "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  331.                 draw.DrawText("PING", "NexaLight20",team_1_panel:GetWide()-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  332.                 draw.RoundedBox(0,0,25,team_1_panel:GetWide(),1,Color(255,255,255,150))
  333.             end
  334.            
  335.         local team_1_scroll = vgui.Create("DScrollPanel", frame)
  336.         team_1_scroll:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall()+team_1_header:GetTall()+team_1_panel:GetTall())
  337.         team_1_scroll:SetSize(team_1_header:GetWide(),height-550)
  338.         team_1_scroll.Paint = function()
  339.             draw.RoundedBox(0,0,0,team_1_scroll:GetWide(),team_1_scroll:GetTall(),Color(119,119,119,150))
  340.         end
  341.        
  342.         local num = 0
  343.         for k, v in pairs(team.GetPlayers(1002)) do
  344.             local nick_lbl = vgui.Create("DButton", team_1_scroll)
  345.             nick_lbl:SetText("")
  346.             nick_lbl:SizeToContents()
  347.             nick_lbl:SetSize(team_1_panel:GetWide(),30)
  348.             nick_lbl:SetPos(0,num*nick_lbl:GetTall())
  349.             nick_lbl.Paint = function()
  350.                 draw.DrawText(v:Nick(), "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  351.                 draw.DrawText(v:Ping(), "NexaLight20",team_1_panel:GetWide()-45,5,Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  352.             end
  353.             num = num + 1
  354.             nick_lbl.DoClick = function()
  355.                 if LocalPlayer():IsUserGroup("trialadmin") or LocalPlayer():IsAdmin() then
  356.                     local parentMenu = DermaMenu()
  357.  
  358.                     local subMenu, parentMenuOption = parentMenu:AddSubMenu( "Change Player Team" )
  359.  
  360.                     local blueOption = subMenu:AddOption( "Blue", function() v:ConCommand("set_team "..v:EntIndex().." 2") end )
  361.                     local redOption = subMenu:AddOption( "Red", function() v:ConCommand("set_team "..v:EntIndex().." 3") end )
  362.                     --local spectatorOption = subMenu:AddOption( "Spectator", function() v:ConCommand("set_team "..v:EntIndex().." 1002") end )
  363.  
  364.                     parentMenu:Open()
  365.                 end
  366.             end
  367.         end
  368.         -------------------------
  369.     end
  370.    
  371.     function Minigames:SoloScoreboard()
  372.         -------[Team 2]---------
  373.         local team_2_header = vgui.Create("DPanel", frame)
  374.         team_2_header:SetSize(frame:GetWide(), 50)
  375.         team_2_header:SetPos(0,host_dpanel:GetTall()+spacing)
  376.         team_2_header.Paint = function()
  377.             draw.RoundedBox(0,0,0,team_2_header:GetWide(),team_2_header:GetTall(),Color(0,0,0,100))
  378.             draw.DrawText("Blue", "NexaLight35",5,10, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  379.             draw.DrawText(team.GetScore(2), "NexaLight40",team_2_header:GetWide()-5,7, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  380.         end
  381.    
  382.         local team_2_panel = vgui.Create("DPanel", frame)
  383.             team_2_panel:SetPos(0,host_dpanel:GetTall()+team_2_header:GetTall()+spacing)
  384.             team_2_panel:SetSize(team_2_header:GetWide(),26)
  385.             team_2_panel.Paint = function()
  386.                 draw.RoundedBox(0,0,0,team_2_panel:GetWide(),team_2_panel:GetTall(),Color(65, 131, 215,150))
  387.                 draw.DrawText("NAME", "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  388.                 draw.DrawText("KILLS", "NexaLight20",team_2_panel:GetWide()-230,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  389.                 draw.DrawText("DEATHS", "NexaLight20",team_2_panel:GetWide()-120,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  390.                 draw.DrawText("PING", "NexaLight20",team_2_panel:GetWide()-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  391.                 draw.RoundedBox(0,0,25,team_2_panel:GetWide(),1,Color(255,255,255,150))
  392.             end
  393.            
  394.         local team_2_scroll = vgui.Create("DScrollPanel", frame)
  395.         team_2_scroll:SetPos(0,host_dpanel:GetTall()+team_2_header:GetTall()+spacing+26)
  396.         team_2_scroll:SetSize(team_2_header:GetWide(),height-250)
  397.         team_2_scroll.Paint = function()
  398.             draw.RoundedBox(0,0,0,team_2_scroll:GetWide(),team_2_scroll:GetTall(),Color(1,155,223,150))
  399.         end
  400.         local num = 0
  401.         for k, v in pairs(team.GetPlayers(2)) do
  402.             local nick_lbl = vgui.Create("DButton", team_2_scroll)
  403.             nick_lbl:SetText("")
  404.             nick_lbl:SizeToContents()
  405.             nick_lbl:SetSize(team_2_panel:GetWide(),30)
  406.             nick_lbl:SetPos(0,num*nick_lbl:GetTall())
  407.             nick_lbl.Paint = function()
  408.                 draw.DrawText(v:Nick(), "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  409.                 draw.DrawText(v:Frags(), "NexaLight20",team_2_panel:GetWide()-260,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  410.                 draw.DrawText(v:Deaths(), "NexaLight20",team_2_panel:GetWide()-180,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  411.                 draw.DrawText(v:Ping(), "NexaLight20",team_2_panel:GetWide()-45,5,Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  412.                
  413.                 if not v:Alive() then
  414.                     draw.RoundedBox(0,0,0,nick_lbl:GetWide(),nick_lbl:GetTall(),Color(210, 215, 211,150))
  415.                 end
  416.             end
  417.             num = num + 1
  418.             nick_lbl.DoClick = function()
  419.                 if LocalPlayer():IsUserGroup("trialadmin") or LocalPlayer():IsAdmin() then
  420.                     local parentMenu = DermaMenu()
  421.  
  422.                     local subMenu, parentMenuOption = parentMenu:AddSubMenu( "Change Player Team" )
  423.  
  424.                     --local blueOption = subMenu:AddOption( "Blue", function() v:ConCommand("set_team "..v:EntIndex().." 2") end )
  425.                     --local redOption = subMenu:AddOption( "Red", function() v:ConCommand("set_team "..v:EntIndex().." 3") end )
  426.                     local spectatorOption = subMenu:AddOption( "Spectator", function() v:ConCommand("set_team "..v:EntIndex().." 1002") end )
  427.  
  428.                     parentMenu:Open()
  429.                 end
  430.             end
  431.         end
  432.         -------------------------
  433.        
  434.         -------[Team 1]---------
  435.         local team_1_header = vgui.Create("DPanel", frame)
  436.         team_1_header:SetSize(frame:GetWide(), 50)
  437.         team_1_header:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall())
  438.         team_1_header.Paint = function()
  439.             draw.RoundedBox(0,0,0,team_1_header:GetWide(),team_1_header:GetTall(),Color(0,0,0,100))
  440.             draw.DrawText("Spectators", "NexaLight35",5,10, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  441.         end
  442.    
  443.         local team_1_panel = vgui.Create("DPanel", frame)
  444.             team_1_panel:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall()+team_1_header:GetTall())
  445.             team_1_panel:SetSize(team_1_header:GetWide(),26)
  446.             team_1_panel.Paint = function()
  447.                 draw.RoundedBox(0,0,0,team_1_panel:GetWide(),team_1_panel:GetTall(),Color(119, 119, 119,150))
  448.                 draw.DrawText("NAME", "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  449.                 draw.DrawText("PING", "NexaLight20",team_1_panel:GetWide()-30,5, Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  450.                 draw.RoundedBox(0,0,25,team_1_panel:GetWide(),1,Color(255,255,255,150))
  451.             end
  452.            
  453.         local team_1_scroll = vgui.Create("DScrollPanel", frame)
  454.         team_1_scroll:SetPos(0,host_dpanel:GetTall()+spacing+team_2_header:GetTall()+team_2_panel:GetTall()+team_2_scroll:GetTall()+team_1_header:GetTall()+team_1_panel:GetTall())
  455.         team_1_scroll:SetSize(team_1_header:GetWide(),height-550)
  456.         team_1_scroll.Paint = function()
  457.             draw.RoundedBox(0,0,0,team_1_scroll:GetWide(),team_1_scroll:GetTall(),Color(119,119,119,150))
  458.         end
  459.        
  460.         local num = 0
  461.         for k, v in pairs(team.GetPlayers(1002)) do
  462.             local nick_lbl = vgui.Create("DButton", team_1_scroll)
  463.             nick_lbl:SetText("")
  464.             nick_lbl:SizeToContents()
  465.             nick_lbl:SetSize(team_1_panel:GetWide(),30)
  466.             nick_lbl:SetPos(0,num*nick_lbl:GetTall())
  467.             nick_lbl.Paint = function()
  468.                 draw.DrawText(v:Nick(), "NexaLight20",5,5, Color(255, 255, 255, 255),TEXT_ALIGN_LEFT)
  469.                 draw.DrawText(v:Ping(), "NexaLight20",team_1_panel:GetWide()-45,5,Color(255, 255, 255, 255),TEXT_ALIGN_RIGHT)
  470.             end
  471.             num = num + 1
  472.             nick_lbl.DoClick = function()
  473.                 if LocalPlayer():IsUserGroup("trialadmin") or LocalPlayer():IsAdmin() then
  474.                     local parentMenu = DermaMenu()
  475.  
  476.                     local subMenu, parentMenuOption = parentMenu:AddSubMenu( "Change Player Team" )
  477.  
  478.                     local blueOption = subMenu:AddOption( "Blue", function() v:ConCommand("set_team "..v:EntIndex().." 2") end )
  479.                     --local redOption = subMenu:AddOption( "Red", function() v:ConCommand("set_team "..v:EntIndex().." 3") end )
  480.                     --local spectatorOption = subMenu:AddOption( "Spectator", function() v:ConCommand("set_team "..v:EntIndex().." 1002") end )
  481.  
  482.                     parentMenu:Open()
  483.                 end
  484.             end
  485.         end
  486.         -------------------------
  487.     end
  488.    
  489.     if Minigames:IsPlayingTeamDeathmatch() or Minigames:IsPlayingTeamSurvival() or Minigames:IsPlayingTwoVersusAll() or Minigames:IsPlayingCaptureTheFlag() then
  490.         Minigames:TeamScoreboard()
  491.     else
  492.         Minigames:SoloScoreboard()
  493.     end
  494.    
  495.     function Minigames:HideScoreboard()
  496.         frame:Remove()
  497.         Minigames.ScoreboardOpen = false
  498.     end
  499.    
  500. 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
 
Top