Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*--------------------------------------------------*\
- | You can only change things before the warning text |
- \*--------------------------------------------------*/
- local clbackground = Color(235,235,235,255) // Default color is 235,235,235,255
- local topbackground = Color(38,38,38,255) // Default color is 63,67,78,255
- local tagsbackground = Color(54,54,54,255) // Default color is 54,54,54,255
- local rowcolor = Color(79,83,95,255) // Default color is 79,83,95,255
- local rowhovercolor = Color(255,255,255,0) // Default color is 255,255,255,0
- local colorrowteam = true // Default false, if it is set to true the player row color will be changed based on the team color.
- -- The logo size has to be 263x75
- -- If logo is set to 0 then there will the blank space if you set a directory it will use that image as logo
- -- When adding a directory do it like this Material("directory/filename.png or jpg")
- local logo = 0
- /*-------*\
- | Warning |
- \*-------*/
- local w,h = ScrW(),ScrH()
- local y,y2 = 0,0
- -- 16:9
- if w == 1280 and h == 720 then y = 75 end
- if w == 1360 and h == 768 then y = 35 end
- if w == 1366 and h == 768 then y = 35 end
- if w == 1600 and h == 900 then y = 0 y2 = 80 end
- if w == 1920 and h == 1080 then y = 0 y2 = 235 end
- -- 16:10
- if w == 1680 and h == 1050 then y = 0 y2 = 120 end
- if w == 1600 and h == 1024 then y = 0 y2 = 80 end
- if w == 1440 and h == 900 then y = 0 y2 = 0 end
- if w == 1280 and h == 800 then y = 80 y2 = 0 end
- if w == 1280 and h == 768 then y = 80 y2 = 0 end
- -- 4:3
- if w == 1280 and h == 1024 then y = 80 y2 = 0 end
- if w == 1280 and h == 900 then y = 80 y2 = 0 end
- if w == 1152 and h == 864 then y = 140 y2 = 0 end
- --[[ Doesn't support the next resolutions
- 1024x768
- 800x600
- 720x576
- 640x480
- ]]
- surface.CreateFont( "Info", {
- font = "Bebas Neue",
- size = 19,
- weight = 500,
- antialias = true
- })
- surface.CreateFont( "Title", {
- font = "Bebas Neue",
- size = 30,
- weight = 500,
- antialias = true
- })
- surface.CreateFont( "OtherInfo", {
- font = "Bebas Neue",
- size = 24,
- weight = 500,
- antialias = true
- })
- surface.CreateFont( "NameRank", {
- font = "Bebas Neue",
- size = 20,
- weight = 500,
- antialias = true
- })
- local function formatNumber(n)
- n = tonumber(n)
- if (!n) then
- return 0
- end
- if n >= 1e14 then return tostring(n) end
- n = tostring(n)
- sep = sep or ","
- local dp = string.find(n, "%.") or #n+1
- for i=dp-4, 1, -3 do
- n = n:sub(1, i) .. sep .. n:sub(i+1)
- end
- return n
- end
- function playercom(parent,x,y,text,image,color,name,command)
- local userbtn = vgui.Create("DButton",parent)
- userbtn:SetPos(x,y)
- userbtn:SetSize(120,35)
- userbtn:SetTextColor(Color(255,255,255))
- userbtn:SetText(text)
- userbtn:SetImage(image)
- userbtn.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
- surface.SetDrawColor(color)
- surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
- end
- userbtn.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- SetClipboardText(command)
- end
- return userbtn
- end
- function command(parent,x,y,text,image,color,command,...)
- local btn = vgui.Create("DButton",parent)
- btn:SetPos(x,y)
- btn:SetSize(120,35)
- btn:SetTextColor(Color(255,255,255))
- btn:SetText(text)
- btn:SetImage(image)
- btn.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
- surface.SetDrawColor(color)
- surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
- end
- local cmdArgs = {...}
- btn.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- RunConsoleCommand(command,unpack(cmdArgs))
- end
- return btn
- end
- function kick(parent,x,y,text,reason,image,color,command,ply)
- local cbtn = vgui.Create("DButton",parent)
- cbtn:SetSize(120,35)
- cbtn:SetPos(x,y)
- cbtn:SetTextColor(Color(255,255,255))
- cbtn:SetText(text)
- cbtn:SetImage(image)
- cbtn.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
- surface.SetDrawColor(color)
- surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
- end
- cbtn.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- local reportmsg = vgui.Create( "DFrame" )
- reportmsg:SetPos(ScrW() / 2 - 200, ScrH() / 2 - 120)
- reportmsg:SetSize(400,100)
- reportmsg:SetTitle("")
- reportmsg:SetVisible(true)
- reportmsg:SetDraggable(false)
- reportmsg:SetBackgroundBlur(true)
- reportmsg:ShowCloseButton(true)
- reportmsg:MakePopup()
- local tellad = vgui.Create("DLabel",reportmsg)
- tellad:SetPos(reportmsg:GetWide()/2-100,22)
- tellad:SetText(reason)
- tellad:SizeToContents()
- story = vgui.Create("DTextEntry",reportmsg)
- story:SetPos(10,42)
- story:SetTall(20)
- story:SetWide(reportmsg:GetWide()-20)
- story:RequestFocus()
- local accept = vgui.Create("DButton",reportmsg)
- accept:SetPos(100,65)
- accept:SetSize(80,30)
- accept:SetImage('icon16/accept.png')
- accept:SetText('Accept')
- accept.DoClick = function()
- if IsValid(reportmsg) then
- reportmsg:Close()
- end
- AlertMessage = story:GetValue()
- RunConsoleCommand("ulx",command,ply,AlertMessage)
- end
- local cancel = vgui.Create("DButton",reportmsg)
- cancel:SetPos(230,65)
- cancel:SetSize(80,30)
- cancel:SetImage('icon16/cross.png')
- cancel:SetText('Cancel')
- cancel.DoClick = function()
- if IsValid(reportmsg) then
- reportmsg:Close()
- end
- end
- end
- return btn
- end
- function ban(parent,x,y,text,reason,image,color,command,ply)
- local cbtn = vgui.Create("DButton",parent)
- cbtn:SetSize(120,35)
- cbtn:SetPos(x,y)
- cbtn:SetTextColor(Color(255,255,255))
- cbtn:SetText(text)
- cbtn:SetImage(image)
- cbtn.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
- surface.SetDrawColor(color)
- surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
- end
- cbtn.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- local menu = DermaMenu()
- local Title = vgui.Create("DLabel")
- Title:SetText(" Ban Time:\n")
- Title:SetFont("UiBold")
- Title:SizeToContents()
- Title:SetTextColor(color_black)
- menu:AddPanel(Title)
- menu:AddOption("1 Hour", function() RunConsoleCommand("ulx",command,ply,60) end)
- menu:AddOption("5 Hour", function() RunConsoleCommand("ulx",command,ply,300) end)
- menu:AddOption("1 day", function() RunConsoleCommand("ulx",command,ply,1440) end)
- menu:AddOption("1 week", function() RunConsoleCommand("ulx",command,ply,10080) end)
- menu:AddOption("1 month", function() RunConsoleCommand("ulx",command,ply,40320) end)
- menu:AddOption("Permanently", function() RunConsoleCommand("ulx",command,ply,0) end)
- menu:Open()
- end
- return btn
- end
- function CustomScoreBoard_Apply()
- function GAMEMODE:ScoreboardShow()
- gui.EnableScreenClicker(true)
- bg = vgui.Create("DFrame")
- bg:SetSize(800,ScrH() - 100)
- bg:SetPos(ScrW()/2-400+y,50)
- bg:SetDraggable(false)
- bg:ShowCloseButton(false)
- bg:SetTitle("")
- bg.Paint = function(self)
- draw.RoundedBox(8,0,0,self:GetWide(),self:GetTall(),Color(0,0,0,255))
- draw.RoundedBox(8,1,1,self:GetWide()-2,self:GetTall()-2,clbackground)
- draw.RoundedBox(0,0,0,self:GetWide(),75,topbackground)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetFont("Title")
- draw.DrawText("CubeSquared DarkRP -- Click on a Players name to pull up the menu","Title",5,2.5,color_white,TEXT_ALIGN_LEFT)
- draw.DrawText("Players: "..table.Count(player.GetAll()),"Info",5,55,color_white,TEXT_ALIGN_LEFT)
- end
- local plytext = vgui.Create("DPanel",bg)
- plytext:SetSize(bg:GetWide()-2,25)
- plytext:SetPos(1,75)
- plytext.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),tagsbackground)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- draw.DrawText("Name","Info",5,2.5,color_white,TEXT_ALIGN_LEFT)
- draw.DrawText("Job","Info",self:GetWide()/2,2.5,color_white,TEXT_ALIGN_CENTER)
- --draw.DrawText("Kills / Deaths","Info",self:GetWide()/1.2,2.5,color_white,TEXT_ALIGN_CENTER)
- draw.DrawText("Ping","Info",self:GetWide()/1.03,2.5,color_white,TEXT_ALIGN_RIGHT)
- end
- plist = vgui.Create("DScrollPanel",bg)
- plist:SetSize(bg:GetWide()-2,799)
- plist:SetPos(1,100)
- plist:SetPadding(5)
- plist.Paint = function(self)
- draw.RoundedBoxEx(6,0,0,self:GetWide(),self:GetTall(),Color(0,0,0,0),false,false,true,true)
- end
- local plys = player.GetAll()
- table.sort(plys, function(a, b) return a:Team() > b:Team() end)
- for k,v in pairs(plys) do
- local group = LocalPlayer():GetNWString("usergroup")
- local money = formatNumber(v:getDarkRPVar("money") or 0)
- local job = v:getDarkRPVar("job") or ""
- local row = vgui.Create("DButton",plist)
- row:SetSize(plist:GetWide(),32)
- row:Dock(TOP)
- row:SetText("")
- row.Paint = function(self)
- if colorrowteam == true then
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),team.GetColor(v:Team()))
- else
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),rowcolor)
- end
- if v == LocalPlayer() then
- surface.SetDrawColor(255,255,255,math.Clamp(math.sin(RealTime()*4)*100,0,255))
- surface.DrawRect(0,0,self:GetWide(),self:GetTall())
- end
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),rowhovercolor)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- color = color_white
- if v:SteamID() == "STEAM_0:1:412455856" then color = Color(180,0,0,200) end
- draw.DrawText(v:Nick(),"NameRank",5,2,color,TEXT_ALIGN_LEFT)
- --draw.DrawText(v:GetNWString("usergroup"),"NameRank",4,16,color,TEXT_ALIGN_LEFT)
- if v:GetNWString("usergroup") == "superadmin" and v:SteamID() ~= "STEAM_0:1:41245856" and v:SteamID() ~= "STEAM_0:1:35013247" then draw.DrawText("Level 4","NameRank",4,16,Color(211,135,255,255),TEXT_ALIGN_LEFT) end
- if v:GetNWString("usergroup") == "admin" then draw.DrawText("Level 3","NameRank",5,16,Color(150,236,255,255),TEXT_ALIGN_LEFT) end
- if v:GetNWString("usergroup") == "donator" then draw.DrawText("Donator","NameRank",5,16,Color(59,237,116,255),TEXT_ALIGN_LEFT) end
- if v:GetNWString("usergroup") == "vip" then draw.DrawText("V.I.P.","NameRank",5,16,Color(200,200,100,255),TEXT_ALIGN_LEFT) end
- if v:SteamID() == "STEAM_0:1:41245856" then draw.DrawText("Owner","NameRank",5,16,Color(255,107,97,255),TEXT_ALIGN_LEFT) end
- if v:SteamID() == "STEAM_0:1:35013247" then draw.DrawText("Co-Owner","NameRank",5,16,Color(255,107,97,255),TEXT_ALIGN_LEFT) end
- --draw.DrawText(team.GetName(v:Team()),"OtherInfo",self:GetWide()/2,5,color,TEXT_ALIGN_CENTER)
- draw.DrawText(job,"OtherInfo",self:GetWide()/2,5,color,TEXT_ALIGN_CENTER)
- --draw.DrawText(v:Frags(),"OtherInfo",self:GetWide()/1.2-27,2.5,color,TEXT_ALIGN_CENTER)
- --draw.DrawText(v:Deaths(),"OtherInfo",self:GetWide()/1.2+20,2.5,color,TEXT_ALIGN_CENTER)
- draw.DrawText(v:Ping(),"OtherInfo",self:GetWide()/1.03,2.5,color,TEXT_ALIGN_RIGHT)
- end
- row.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- if IsValid(info) then info:SetVisible(false) end
- if LocalPlayer():IsAdmin() then infoy = 300 comy = 170 combgy = 195 combgh = 99 else infoy = 300 comy = 170 combgy = 195 combgh = 99 end
- info = vgui.Create("DFrame")
- info:SetSize(263,infoy)
- info:SetPos(bg:GetWide()-760+y2,ScrH()/2-350)
- info:SetDraggable(false)
- info:ShowCloseButton(false)
- info:SetTitle("")
- info.Paint = function(self)
- draw.RoundedBox(8,0,0,self:GetWide(),self:GetTall(),Color(0,0,0,255))
- draw.RoundedBox(8,1,1,self:GetWide()-2,self:GetTall()-2,clbackground)
- if logo == 0 then
- draw.RoundedBox(0,0,0,self:GetWide(),75,topbackground)
- else
- surface.SetDrawColor(255,255,255,255)
- surface.SetMaterial(logo)
- surface.DrawTexturedRect(0,0,self:GetWide(),75)
- end
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- end
- local infotab = vgui.Create("DPanel",info)
- infotab:SetSize(info:GetWide()-2,25)
- infotab:SetPos(1,75)
- infotab.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),tagsbackground)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- draw.DrawText("Information","Info",5,2.5,color_white,TEXT_ALIGN_LEFT)
- end
- local infobg = vgui.Create("DPanel",info)
- infobg:SetSize(info:GetWide()-2,170)
- infobg:SetPos(1,100)
- infobg.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),clbackground)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- draw.DrawText(v:Nick(),"Info",2,5,Color(60,60,60),TEXT_ALIGN_LEFT)
- --draw.DrawText(v:GetNWString("usergroup"),"Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT)
- if v:GetNWString("usergroup") == "superadmin" and v:SteamID() ~= "STEAM_0:1:41245856" and v:SteamID() ~= "STEAM_0:1:35013247" then draw.DrawText("Level 4","Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT) end
- if v:GetNWString("usergroup") == "admin" then draw.DrawText("Level 3","Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT) end
- if v:GetNWString("usergroup") == "donator" then draw.DrawText("Donator","Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT) end
- if v:SteamID() == "STEAM_0:1:41245856" then draw.DrawText("Owner","Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT) end
- if v:SteamID() == "STEAM_0:1:35013247" then draw.DrawText("Co-Owner","Info",2,25,Color(60,60,60),TEXT_ALIGN_LEFT) end
- draw.DrawText(team.GetName(v:Team()),"Info",2,45,Color(60,60,60),TEXT_ALIGN_LEFT)
- end
- local commandstab = vgui.Create("DPanel",info)
- commandstab:SetSize(info:GetWide()-2,25)
- commandstab:SetPos(1,comy)
- commandstab.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),tagsbackground)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- draw.DrawText("Commands","Info",5,2.5,color_white,TEXT_ALIGN_LEFT)
- end
- local commandsbg = vgui.Create("DScrollPanel",info)
- commandsbg:SetSize(info:GetWide()-2,combgh)
- commandsbg:SetPos(1,combgy)
- commandsbg:SetPadding(5)
- commandsbg.Paint = function(self)
- draw.RoundedBoxEx(8,0,0,self:GetWide(),self:GetTall(),clbackground,false,false,true,true)
- surface.SetDrawColor(0,0,0,255)
- surface.DrawLine(0,0,self:GetWide(),0)
- surface.SetDrawColor(61,61,61,255)
- surface.DrawLine(0,1,self:GetWide(),1)
- end
- playercom(commandsbg,5,10,"Copy SteamID","icon16/tag_blue.png",Color(255,200,0,255),"The SteamID",v:SteamID())
- playercom(commandsbg,135,10,"Copy Name","icon16/user_edit.png",Color(255,200,0,255),"The Name",v:Nick())
- local userbtn = vgui.Create("DButton",commandsbg)
- userbtn:SetSize(120,35)
- userbtn:SetPos(67.5,50)
- userbtn:SetTextColor(Color(255,255,255))
- userbtn:SetText(" Steam Profile")
- userbtn:SetImage("icon16/world.png")
- userbtn.Paint = function(self)
- draw.RoundedBox(0,0,0,self:GetWide(),self:GetTall(),Color(51,51,51,255))
- surface.SetDrawColor(Color(255,50,50,255))
- surface.DrawOutlinedRect(0,0,self:GetWide(),self:GetTall())
- userbtn.DoClick = function()
- surface.PlaySound("buttons/button9.wav")
- v:ShowProfile()
- end
- end -- End if Player is Admin
- end -- End Row DoClick
- function row:Think()
- if not IsValid(v) then
- row:Remove()
- if IsValid(avatar) then avatar:Remove() end
- if IsValid(info) then info:Remove() end
- end
- end -- End Row Think
- end -- End For Loop
- end // End Scoreboard
- function GAMEMODE:ScoreboardHide()
- gui.EnableScreenClicker(false)
- if IsValid(bg) then bg:Remove() end
- if IsValid(info) then info:Remove() end
- end
- end
- CustomScoreBoard_Apply()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement