• HELP SCOREBOARD
    1 replies, posted
I need that whenever I click on the player the panel is displayed, where I can teleport to it, ban and so on, help me please, here is my code [CODE]------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------&#1058;&#1040;&#1041; &#1053;&#1040;&#1055;&#1048;&#1057;&#1040;&#1051; Kydesn1k------------------------------------------------------------------------- -------------------------------------------------------------&#1057;&#1086;&#1073;&#1089;&#1090;&#1077;&#1085;&#1085;&#1086;&#1074;&#1086;&#1089;&#1090;&#1100; l Relax l &#1053;&#1086;&#1074;&#1099;&#1081; &#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; SCP-RP-------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local Scoreboard = nil local PlayerListTop = nil surface.CreateFont("ScoreBoardFont", { font = "Cyrillic", size = 16, weight = 900, blursize = 0, scanlines = 0, antialias = true, extended = true, }) surface.CreateFont("ScoreBoardTitleFont", { font = "Cyrillic", size = 25, weight = 900, blursize = 0, scanlines = 0, antialias = true, extended = true, }) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- commands = {} local function addCommand( name, func ) commands[ name ] = func end addCommand( "&#1057;&#1082;&#1086;&#1087;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100; SteamID", function( pl ) SetClipboardText( pl:SteamID() ) end ) addCommand( "&#1058;&#1055; &#1082; &#1085;&#1077;&#1084;&#1091;", function( pl ) RunConsoleCommand( "say", "!goto "..pl:Nick() ) end ) addCommand( "&#1058;&#1087; &#1082; &#1089;&#1077;&#1073;&#1077;", function( pl ) RunConsoleCommand( "say", "!bring "..pl:Nick() ) end ) addCommand( "&#1042;&#1077;&#1088;&#1085;&#1091;&#1090;&#1100;", function( pl ) RunConsoleCommand( "say", "!return "..pl:Nick() ) end ) addCommand( "&#1060;&#1088;&#1080;&#1079;", function( pl ) RunConsoleCommand( "say", "!freeze "..pl:Nick() ) end ) addCommand( "&#1056;&#1072;&#1079;&#1092;&#1088;&#1080;&#1079;&#1080;&#1090;&#1100;", function( pl ) RunConsoleCommand( "say", "!unfreeze "..pl:Nick() ) end ) UserGroupTitlesScoreboard = {} UserGroupTitlesScoreboard["superadmin"] = "&#1057;" UserGroupTitlesScoreboard["admin"] = "&#1040;" UserGroupTitlesScoreboard["moderator"] = "&#1052;" UserGroupTitlesScoreboard["user"] = "" UserGroupTitlesScoreboard["admin_d"] = "&#1040;" UserGroupTitlesScoreboard["superadmin_d"] = "&#1057;&#1040;" UserGroupTitlesScoreboard["lpk"] = "" UserGroupTitlesScoreboard["vip"] = "" hook.Add( "ScoreboardShow", "SCP-SCOREBOARD", function(ply) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local function SteamToProfile(ply) -- Thanks decodaman return 'http://steamcommunity.com/profiles/' .. (ply:SteamID64() or "BOT") end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local function blur(p,w,h) local px, py = p:GetPos() local blurTex = Material( "pp/blurscreen" ) blurTex:SetFloat( "$blur", 3 ) blurTex:Recompute() render.UpdateScreenEffectTexture() surface.SetMaterial( blurTex ) surface.SetDrawColor( 255, 255, 255, 255 ) surface.DrawTexturedRect( -px, -py, ScrW(), ScrH() ) surface.SetDrawColor( 0,0,0,60 ) surface.DrawRect( 0, 0, w, h ) surface.SetDrawColor( 120,120,120,120 ) surface.DrawOutlinedRect( 0, 0, w, h ) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- if !IsValid(Scoreboard) then local x,y = ScrW(), ScrH() Scoreboard = vgui.Create("DFrame") Scoreboard:SetSize(600,800) Scoreboard:SetPos(x / 2 - 250,y - 600) Scoreboard:SetTitle("") local S = Scoreboard:GetSize() Scoreboard:SetDraggable( false ) Scoreboard:ShowCloseButton( false ) Scoreboard:MoveTo(x / 2 - 250,y / 2 - 400,0.8, 0, 1) Scoreboard.Paint = function(self, w, h) blur(self,w,h) surface.SetDrawColor(team.GetColor(LocalPlayer():Team())) surface.DrawOutlinedRect(0,0,w,h) /*surface.SetDrawColor(255,255,255) surface.SetMaterial( Material( "logo/scp.png" ) ) surface.DrawTexturedRect(0,0, 36 / 1.5 ,36 / 1.5)*/ draw.SimpleTextOutlined(GetHostName(),"ScoreBoardTitleFont",S / 2 / 2 - 10,25,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) draw.SimpleTextOutlined("&#1048;&#1084;&#1103;","ScoreBoardFont", 50,50,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) draw.SimpleTextOutlined("&#1055;&#1080;&#1085;&#1075;","ScoreBoardFont",S - 50,50,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) draw.SimpleTextOutlined("&#1055;&#1088;&#1086;&#1092;&#1077;&#1089;&#1089;&#1080;&#1103;","ScoreBoardFont",S / 2 - 34 ,50,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) draw.SimpleTextOutlined("&#1059;&#1088;&#1086;&#1074;&#1077;&#1085;&#1100;","ScoreBoardFont",S / 2 + 145 ,50,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) --draw.SimpleTextOutlined("&#1057;&#1086;&#1079;&#1076;&#1072;&#1083; TAB - Kydesn1k","ScoreBoardFont", 15,S / 2 + 480,Color(255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER,1,Color(0,0,0,180)) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- local ListPanel = vgui.Create("DPanel", Scoreboard) ListPanel:SetSize(580,700) ListPanel:SetPos(10,60) ListPanel.Paint = function(self,w,h) draw.RoundedBox(2,0,0,w,h,Color(255,255,255,0)) surface.SetDrawColor(team.GetColor(LocalPlayer():Team())) surface.DrawOutlinedRect(0,0,w,h) end local PlayerScrollPanel = vgui.Create("DScrollPanel", ListPanel) PlayerScrollPanel:SetSize(ListPanel:GetWide(),ListPanel:GetTall()) PlayerScrollPanel:SetPos(2,2) PlayerListTop = vgui.Create("DListLayout", PlayerScrollPanel) PlayerListTop:SetSize(PlayerScrollPanel:GetWide()-4,PlayerScrollPanel:GetTall()-4) PlayerListTop:SetPos(0,0) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- if IsValid(Scoreboard) then PlayerListTop:Clear() local PLAYERS = player.GetAll() table.sort( PLAYERS, function( a, b ) return team.GetName( a:Team() ) < team.GetName( b:Team() ) end ) for k,v i
Next time please translate everything to english. All you need is [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/DermaMenu]DermaMenu[/url]. Btw, after the last update to [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gui/OpenURL]gui.OpenURL[/url], try to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/ShowProfile]Player:ShowProfile[/url] for players profile buttons.
Sorry, you need to Log In to post a reply to this thread.