CreateClientConVar("rp_playermodel", "", true, true) --{ local function drawText( text, font, x, y, color, alignx, aligny ) surface.SetFont( font ) local w, h = surface.GetTextSize( text ) surface.SetTextColor( color ) surface.SetTextPos( math.floor( x - ( ( alignx or 0 ) * w ) ), math.floor( y - ( ( aligny or 0 ) * h ) ) ) surface.DrawText( text ) end local function drawTextOutlined( text, font, x, y, color, alignx, aligny, outline, coloro ) surface.SetFont( font ) local w, h = surface.GetTextSize( text ) surface.SetTextColor( coloro ) x, y, outline = math.floor( x - ( ( alignx or 0 ) * w ) ), math.floor( y - ( ( aligny or 0 ) * h ) ), math.floor( outline ) for i = -outline, outline do for j = -outline, outline do surface.SetTextPos( x + i, y + j ) surface.DrawText( text ) end end surface.SetTextColor( color ) surface.SetTextPos( x, y ) surface.DrawText( text ) end local function drawRect( x, y, w, h, color ) x, y, w, h = math.floor( x ), math.floor( y ), math.floor( w ), math.floor( h ) surface.SetDrawColor( color ) surface.DrawRect( x, y, w, h ) end local function drawRectOutlined( x, y, w, h, color ) x, y, w, h = math.floor( x ), math.floor( y ), math.floor( w ), math.floor( h ) surface.SetDrawColor( color ) surface.DrawOutlinedRect( x, y, w, h ) end local roundedTex8 = surface.GetTextureID( "gui/corner8" ) local roundedTex16 = surface.GetTextureID( "gui/corner16" ) local function drawRectRounded( x, y, w, h, color, radius, tl, tr, bl, br ) x, y, w, h, radius = math.floor( x ), math.floor( y ), math.floor( w ), math.floor( h ), math.floor( radius / 2 ) * 2 surface.SetDrawColor( color ) surface.SetTexture( radius > 8 and roundedTex16 or roundedTex8 ) if tl == false then surface.DrawRect( x, y, radius, radius ) else surface.DrawTexturedRectRotated( x + radius / 2, y + radius / 2, radius, radius, 0 ) end if tr == false then surface.DrawRect( x + w - radius, y, radius, radius ) else surface.DrawTexturedRectRotated( x + w - radius / 2, y + radius / 2, radius, radius, 270 ) end if bl == false then surface.DrawRect( x, y + h - radius, radius, radius ) else surface.DrawTexturedRectRotated( x + radius / 2, y + h - radius / 2, radius, radius, 90 ) end if br == false then surface.DrawRect( x + w - radius, y + h - radius, radius, radius ) else surface.DrawTexturedRectRotated( x + w - radius / 2, y + h - radius / 2, radius, radius, 180 ) end surface.DrawRect( x + radius, y, w - radius * 2, radius ) surface.DrawRect( x + radius, y + h - radius, w - radius * 2, radius ) surface.DrawRect( x, y + radius, w, h - radius * 2 ) end local drawRectMatCache = {} local function drawRectMat( x, y, w, h, mat, color, overloadCache ) if type( mat ) == "string" and ( not drawRectMatCache[ mat ] or overloadCache ) then drawRectMatCache[ mat ] = Material( mat ) end surface.SetDrawColor( color or color_white ) surface.SetMaterial( type( mat ) == "IMaterial" and mat or drawRectMatCache[ mat ] ) surface.DrawTexturedRect( x, y, w, h ) end local drawRectTexCache = {} local function drawRectTex( x, y, w, h, tex, color, overloadCache ) if not drawRectTexCache[ tex ] or overloadCache then drawRectTexCache[ tex ] = surface.GetTextureID( tex ) end surface.SetDrawColor( color or color_white ) surface.SetTexture( drawRectTexCache[ tex ] ) surface.DrawTexturedRect( x, y, w, h ) end local function drawRectTexRotated( x, y, w, h, tex, color, rot, overloadCache ) if not drawRectTexCache[ tex ] or overloadCache then drawRectTexCache[ tex ] = surface.GetTextureID( tex ) end surface.SetDrawColor( color or color_white ) surface.SetTexture( drawRectTexCache[ tex ] ) surface.DrawTexturedRectRotated( x, y, w, h, rot ) end local function drawGradient( x, y, w, h, color1, color2, horizontal ) x, y, w, h = math.floor( x ), math.floor( y ), math.floor( w ), math.floor( h ) if horizontal then for i = 0, w - 1 do surface.SetDrawColor( color1.r * ( 1 - i / ( w - 1 ) ) + color2.r * i / ( w - 1 ), color1.g * ( 1 - i / ( w - 1 ) ) + color2.g * i / ( w - 1 ), color1.b * ( 1 - i / ( w - 1 ) ) + color2.b * i / ( w - 1 ), color1.a * ( 1 - i / ( w - 1 ) ) + color2.a * i / ( w - 1 ) ) surface.DrawRect( x + i, y, 1, h ) end else for i = 0, h - 1 do surface.SetDrawColor( color1.r * ( 1 - i / ( h - 1 ) ) + color2.r * i / ( h - 1 ), color1.g * ( 1 - i / ( h - 1 ) ) + color2.g * i / ( h - 1 ), color1.b * ( 1 - i / ( h - 1 ) ) + color2.b * i / ( h - 1 ), color1.a * ( 1 - i / ( h - 1 ) ) + color2.a * i / ( h - 1 ) ) surface.DrawRect( x, y + i, w, 1 ) end end end local function drawGradientRounded( x, y, w, h, color1, color2, radius, horizontal ) x, y, w, h, radius = math.floor( x ), math.floor( y ), math.floor( w ), math.floor( h ), math.floor( radius / 2 ) * 2 surface.SetTexture( radius > 8 and roundedTex16 or roundedTex8 ) if horizontal then surface.SetDrawColor( color1 ) surface.DrawTexturedRectRotated( x + radius / 2, y + radius / 2, radius, radius, 0 ) surface.DrawRect( x, y + radius, radius, h - radius * 2 ) surface.DrawTexturedRectRotated( x + radius / 2, y + h - radius / 2, radius, radius, 90 ) surface.SetDrawColor( color2 ) surface.DrawTexturedRectRotated( x + w - radius / 2, y + radius / 2, radius, radius, 270 ) surface.DrawRect( x + w - radius, y + radius, radius, h - radius * 2 ) surface.DrawTexturedRectRotated( x + w - radius / 2, y + h - radius / 2, radius, radius, 180 ) for i = 0, w - radius * 2 - 1 do surface.SetDrawColor( color1.r * ( 1 - i / ( w - radius * 2 - 1 ) ) + color2.r * i / ( w - radius * 2 - 1 ), color1.g * ( 1 - i / ( w - radius * 2 - 1 ) ) + color2.g * i / ( w - radius * 2 - 1 ), color1.b * ( 1 - i / ( w - radius * 2 - 1 ) ) + color2.b * i / ( w - radius * 2 - 1 ), color1.a * ( 1 - i / ( w - radius * 2 - 1 ) ) + color2.a * i / ( w - radius * 2 - 1 ) ) surface.DrawRect( x + radius + i, y, 1, h ) end else surface.SetDrawColor( color1 ) surface.DrawTexturedRectRotated( x + radius / 2, y + radius / 2, radius, radius, 0 ) surface.DrawRect( x + radius, y, w - radius * 2, radius ) surface.DrawTexturedRectRotated( x + w - radius / 2, y + radius / 2, radius, radius, 270 ) surface.SetDrawColor( color2 ) surface.DrawTexturedRectRotated( x + radius / 2, y + h - radius / 2, radius, radius, 90 ) surface.DrawRect( x + radius, y + h - radius, w - radius * 2, radius ) surface.DrawTexturedRectRotated( x + w - radius / 2, y + h - radius / 2, radius, radius, 180 ) for i = 0, h - radius * 2 - 1 do surface.SetDrawColor( color1.r * ( 1 - i / ( h - radius * 2 - 1 ) ) + color2.r * i / ( h - radius * 2 - 1 ), color1.g * ( 1 - i / ( h - radius * 2 - 1 ) ) + color2.g * i / ( h - radius * 2 - 1 ), color1.b * ( 1 - i / ( h - radius * 2 - 1 ) ) + color2.b * i / ( h - radius * 2 - 1 ), color1.a * ( 1 - i / ( h - radius * 2 - 1 ) ) + color2.a * i / ( h - radius * 2 - 1 ) ) surface.DrawRect( x, y + radius + i, w, 1 ) end end end local function drawGradientCheap( x, y, w, h, c, r ) drawRectTexRotated( x, y, w, h, "gui/gradient", c, r ) end --} surface.CreateFont( "F4.General", { size = 24, weight = 700 } ) surface.CreateFont( "F4.GeneralBut", { size = 18, weight = 700 } ) function TabGeneral() local par = vgui.Create( "DPanelList", F4Menu ) par:SetPos( 5, 65 ) par:SetSize( 490, 430 ) par:EnableVerticalScrollbar( true ) par:SetSpacing( 5 ) par:SetPadding( 5 ) par.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end function par:Update() self:Clear() local function addLabel( t ) local lab = vgui.Create( "DPanel", self ) lab:SetTall( 40 ) function lab:Paint( w, h ) drawTextOutlined( t, "F4.General", w / 2, 20, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) end self:AddItem( lab ) end local function addButton( t, c, f ) local but = vgui.Create( "DButton", self ) but:SetTall( 30 ) but:SetText( "" ) but.DoClick = f function but:Paint( w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, c, 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( t, "F4.GeneralBut", w / 2 + 11, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end self:AddItem( but ) end local col_money = Color( 80, 240, 80 ) local col_norm = Color( 120, 120, 120 ) local col_mayor = Color( 240, 60, 60 ) local col_cp = Color( 80, 80, 240 ) local col_cit = Color( 80, 240, 80 ) local col_mob = Color( 60, 60, 60 ) addLabel( "Money Commands" ) addButton( "Give money to player in front", col_money, function() Derma_StringRequest("Amount of money", "How much money do you want to give?", "", function(a) LocalPlayer():ConCommand("darkrp /give " .. tostring(a)) end) end ) addButton( "Drop money", col_money, function() Derma_StringRequest("Amount of money", "How much money do you want to drop?", "", function(a) LocalPlayer():ConCommand("darkrp /dropmoney " .. tostring(a)) end) end ) addLabel( "General Commands" ) addButton( "Change Name", col_norm, function() Derma_StringRequest("Change name", "What would you like to change your name to?", "", function(a) LocalPlayer():ConCommand("darkrp /rpname " .. tostring(a)) end) end ) -- addButton( "Sleep", col_norm, function() -- LocalPlayer():ConCommand("darkrp /sleep") -- end ) addButton( "Drop current Weapon", col_norm, function() LocalPlayer():ConCommand("darkrp /drop") end ) addButton( "Buy health (" .. GAMEMODE.Config.healthcost .. ")", col_norm, function() LocalPlayer():ConCommand("darkrp /Buyhealth") end ) if LocalPlayer():Team() ~= TEAM_MAYOR then addButton( "Request Gun license", col_norm, function() LocalPlayer():ConCommand("darkrp /requestlicense") end ) end addButton( "Vote Demote", col_norm, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("Demote reason", "Why would you demote "..ply:Nick().."?", nil, function(a) LocalPlayer():ConCommand("darkrp /demote \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end ) addButton( "Sell all of your doors", col_norm, function() LocalPlayer():ConCommand("darkrp /unownalldoors") end ) if LocalPlayer():Team() == TEAM_MAYOR then addLabel( "Mayor Commands" ) addButton( "New Search Warrant", col_mayor, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.warrant and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("Warrant", "Why would you warrant "..ply:Nick().."?", nil, function(a) LocalPlayer():ConCommand("darkrp /warrant \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end ) addButton( "New Wanted Person", col_mayor, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("wanted", "Why would you make "..ply:Nick().." wanted?", nil, function(a) LocalPlayer():ConCommand("darkrp /wanted \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end ) addButton( "Dismiss Wanted Person", col_mayor, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() LocalPlayer():ConCommand("darkrp /unwanted \"" .. ply:SteamID() .. "\"") end) end end menu:Open() end ) addButton( "Begin Lock Down", col_mayor, function() LocalPlayer():ConCommand("darkrp /lockdown") end ) addButton( "End Lock Down", col_mayor, function() LocalPlayer():ConCommand("darkrp /unlockdown") end ) addButton( "Start a Lottery", col_mayor, function() LocalPlayer():ConCommand("darkrp /lottery") end ) addButton( "Give Gun License", col_mayor, function() LocalPlayer():ConCommand("darkrp /givelicense") end ) addButton( "Display Laws", col_mayor, function() LocalPlayer():ConCommand("darkrp /placelaws") end ) addButton( "Add Law", col_mayor, function() Derma_StringRequest("Add a law", "Type the law you would like to add here.", "", function(law) LocalPlayer():ConCommand("darkrp /addlaw " .. law) end) end ) addButton( "Remove Law", col_mayor, function() Derma_StringRequest("Remove a law", "Enter the number of the law you would like to remove here.", "", function(num) LocalPlayer():ConCommand("darkrp /removelaw " .. num) end) end ) elseif LocalPlayer():Team() == TEAM_CITIZEN then addLabel( "Citizen Commands" ) addButton( "Change Job Name", col_cit, function() Derma_StringRequest("Change job name", "What would you like to change your job name to?", "", function(a) LocalPlayer():ConCommand("darkrp /job " .. tostring(a)) end) end ) elseif LocalPlayer():Team() == TEAM_MOB then addLabel( "Mobboss Commands" ) addButton( "Change Agenda", col_mob, function() Derma_StringRequest("Change agenda", "What would you like to change the agenda to? (You can use \\n to denote new lines)", "", function(a) LocalPlayer():ConCommand("darkrp /agenda " .. tostring(a)) end) end ) elseif LocalPlayer():IsCP() then addLabel( "CP Commands" ) addButton( "New Search Warrant", col_cp, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.warrant and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("Warrant", "Why would you warrant "..ply:Nick().."?", nil, function(a) LocalPlayer():ConCommand("darkrp /warrant \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end ) addButton( "New Wanted Person", col_cp, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("wanted", "Why would you make "..ply:Nick().." wanted?", nil, function(a) LocalPlayer():ConCommand("darkrp /wanted \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end ) addButton( "Dismiss Wanted Person", col_cp, function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() LocalPlayer():ConCommand("darkrp /unwanted \"" .. ply:SteamID() .. "\"") end) end end menu:Open() end ) if LocalPlayer():Team() == TEAM_CHIEF or LocalPlayer():IsAdmin() then addButton( "Set Jail Position", col_cp, function() LocalPlayer():ConCommand("darkrp /jailpos") end ) addButton( "Add a Jail Position", col_cp, function() LocalPlayer():ConCommand("darkrp /addjailpos") end ) end local mayor = false local chief = false for k, v in pairs( player.GetAll() ) do if v:Team() == TEAM_MAYOR then mayor = true break end end if not mayor then for k, v in pairs( player.GetAll() ) do if v == LocalPlayer() then continue end if v:Team() == TEAM_CHIEF then chief = true break end end if not chief then addButton( "Give Gun License", col_cp, function() LocalPlayer():ConCommand("darkrp /givelicense") end ) end end end end return par end surface.CreateFont( "F4.Jobs", { size = 24, weight = 700 } ) surface.CreateFont( "F4.JobsDesc", { size = 12, weight = 700 } ) function TabJobs() local par = vgui.Create( "DPanelList", F4Menu ) par:SetPos( 5, 65 ) par:SetSize( 490, 430 ) par:EnableHorizontal( true ) par:EnableVerticalScrollbar( true ) par:SetPadding( 5 ) par:SetSpacing( 5 ) par.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end par.VBar.SetUp = function( self, _barsize_, _canvassize_ ) self.BarSize = _barsize_ self.CanvasSize = math.max( _canvassize_ - _barsize_, 1 ) self:SetEnabled( true ) self:InvalidateLayout() end local col, ct local over = vgui.Create( "DPanel", par ) over:SetSize( par:GetSize() ) over.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) drawRectRounded( 2, 2, w - 4, 40, Color( 0, 0, 0 ), 4 ) drawRectRounded( 3, 3, w - 6, 38, col, 4 ) drawTextOutlined( ct.name, "F4.Jobs", w / 2, 22, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) end over:SetVisible( false ) local model = vgui.Create( "DModelPanel", over ) model:SetPos( 5, 45 ) model:SetSize( 160, 385 ) model:SetCamPos( Vector( 40, 0, 45 ) ) local desc = vgui.Create( "DLabel", over ) desc:SetPos( 170, 50 ) desc:SetSize( 310, 300 ) desc:SetWrap( true ) desc:SetExpensiveShadow( 1 ) local back = vgui.Create( "DButton", over ) back:SetSize( 80, 30 ) back:SetPos( 320, 395 ) back:SetText( "" ) back.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( "Back", "F4.GeneralBut", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end back.DoClick = function() over:SetVisible( false ) end local go = vgui.Create( "DButton", over ) go:SetSize( 80, 30 ) go:SetPos( 405, 395 ) go:SetText( "" ) go.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, col, 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( "Change", "F4.GeneralBut", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end go.DoClick = function() local function go(frame) if (not ct.RequiresVote and ct.vote) or (ct.RequiresVote and ct.RequiresVote(LocalPlayer(), k)) then local condition = ((ct.admin == 0 and LocalPlayer():IsAdmin()) or (ct.admin == 1 and LocalPlayer():IsSuperAdmin()) or LocalPlayer().DarkRPVars["Priv"..ct.command]) if condition then local menu = DermaMenu() menu:AddOption("Vote", function() LocalPlayer():ConCommand("darkrp /vote" .. ct.command) if IsValid( frame ) then frame:Close() end over:SetVisible( false ) GAMEMODE.ShowSpare2() end) menu:AddOption("Do not vote", function() LocalPlayer():ConCommand("darkrp /" .. ct.command) if IsValid( frame ) then frame:Close() end over:SetVisible( false ) GAMEMODE.ShowSpare2() end) menu:Open() else LocalPlayer():ConCommand( "darkrp /vote" .. ct.command ) if IsValid( frame ) then frame:Close() end over:SetVisible( false ) GAMEMODE.ShowSpare2() end else LocalPlayer():ConCommand( "darkrp /" .. ct.command ) if IsValid( frame ) then frame:Close() end over:SetVisible( false ) GAMEMODE.ShowSpare2() end end if type(ct.model) == "table" and #ct.model > 0 then local frame = vgui.Create("DFrame") frame:SetTitle("Choose model") frame:SetVisible(true) frame:MakePopup() local levels = 1 local IconsPerLevel = math.floor(ScrW()/64) while #ct.model * (64/levels) > ScrW() do levels = levels + 1 end frame:SetSize(math.Min(#ct.model * 64, IconsPerLevel*64), math.Min(90+(64*(levels-1)), ScrH())) frame:Center() local CurLevel = 1 for k,v in pairs(ct.model) do local icon = vgui.Create("SpawnIcon", frame) if (k-IconsPerLevel*(CurLevel-1)) > IconsPerLevel then CurLevel = CurLevel + 1 end icon:SetPos((k-1-(CurLevel-1)*IconsPerLevel) * 64, 25+(64*(CurLevel-1))) icon:SetModel(v) icon:SetSize(64, 64) icon:SetToolTip() icon.DoClick = function() RunConsoleCommand("rp_playermodel", v) RunConsoleCommand("_rp_ChosenModel", v) go(frame) end end else go() end end function par:Update() self:Clear() local teams = {} for k, v in pairs( player.GetAll() ) do teams[ v:Team() ] = ( teams[ v:Team() ] or 0 ) + 1 end for tid, t in ipairs( RPExtraTeams ) do if tid == LocalPlayer():Team() then continue end if t.admin == 1 and not LocalPlayer():IsAdmin() then continue end if t.admin > 1 and not LocalPlayer():IsSuperAdmin() then continue end if t.customCheck and not t.customCheck( LocalPlayer() ) then continue end if (type(t.NeedToChangeFrom) == "number" and LocalPlayer():Team() ~= t.NeedToChangeFrom) or (type(t.NeedToChangeFrom) == "table" and not table.HasValue(t.NeedToChangeFrom, LocalPlayer():Team())) then continue end if not teams[ tid ] then teams[ tid ] = 0 end local but = vgui.Create( "DButton", par ) par:AddItem( but ) but:SetSize( 230, 40 ) but:SetText( "" ) but.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, team.GetColor( tid ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( t.name .. " (" .. teams[ tid ] .. ( t.max ~= 0 and "/" .. t.max or "/∞" ) .. ")", "F4.GeneralBut", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end but.DoClick = function( self ) ct = t col = team.GetColor( tid ) model:SetModel( type( t.model ) == "table" and table.Random( t.model ) or t.model ) over:SetVisible( true ) desc:SetText( t.description .. "\n\n" .. ( #t.weapons == 0 and "No extra weapons." or "Extra Weapons:\n" .. table.concat( t.weapons, "\n" ) ) ) end end end return par end surface.CreateFont( "F4.Store", { size = 12, weight = 700 } ) function TabStore() local par = vgui.Create( "DPanelList", F4Menu ) par:SetPos( 5, 65 ) par:SetSize( 490, 430 ) par:EnableVerticalScrollbar( true ) par:SetPadding( 5 ) par:SetSpacing( 5 ) par.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end function par:Update() self:Clear() local function addLabel( t ) local lab = vgui.Create( "DPanel", self ) lab:SetTall( 40 ) function lab:Paint( w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) drawGradientCheap( w / 2, h / 2, h, w, Color( 0, 0, 0, 100 ), 90 ) drawTextOutlined( t, "F4.General", 10, 20, Color( 255, 255, 255 ), 0, 0.5, 1, Color( 0, 0, 0 ) ) end self:AddItem( lab ) return lab end local function addList( t ) local list = vgui.Create( "DPanelList", self ) list:SetTall( 64 ) list:SetSpacing( 5 ) list:EnableHorizontal( true ) list:SetAutoSize( true ) for k, v in pairs(t) do local icon = vgui.Create( "SpawnIcon", list ) icon:SetModel( v[1] ) icon:SetTooltip( v[2] .. " - $" .. v[3] ) if v[5] then icon:SetSkin( v[5] ) end list:AddItem( icon ) icon.tpos = 0 function icon:PaintOver( w, h ) drawRectRounded( 0, 0, w, 16, Color( 0, 0, 0, 100 ), 4, true, true, false, false ) drawRectRounded( 0, h - 16, w, 16, Color( 0, 0, 0, 100 ), 4, false, false, true, true ) local t = v[2] surface.SetFont( "F4.Store" ) if surface.GetTextSize( t ) + 4 > w and not self.Hovered then local nt = "" for k, v in pairs( string.Explode( "", v[2] ) ) do if surface.GetTextSize( nt .. v .. "..." ) + 4 > w then t = nt .. "..." break else nt = nt .. v end end end if self.Hovered and surface.GetTextSize( v[2] ) + 4 > w then self.tpos = self.tpos - FrameTime() * 40 if self.tpos < -surface.GetTextSize( v[2] ) / 2 - w / 2 then self.tpos = surface.GetTextSize( v[2] ) / 2 + w / 2 end else self.tpos = 0 end drawTextOutlined( t, "F4.Store", w / 2 + self.tpos, 8, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawTextOutlined( "$" .. v[3], "F4.Store", w / 2, h - 8, Color( 150, 255, 150 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) surface.SetDrawColor( 0, 0, 0, 100 ) surface.DrawRect( 0, 16, 1, h - 32 ) surface.DrawRect( w - 1, 16, 1, h - 32 ) end icon.DoClick = function() LocalPlayer():ConCommand( "darkrp " .. v[4] ) end end self:AddItem( list ) end local ok = false local ret = addLabel( "Weaponry" ) local t = {} for k, v in pairs( CustomShipments ) do if not GAMEMODE:CustomObjFitsMap(v) then continue end if (v.seperate and (not GAMEMODE.Config.restrictbuypistol or (GAMEMODE.Config.restrictbuypistol and (not v.allowed[1] or table.HasValue(v.allowed, LocalPlayer():Team()))))) and (not v.customCheck or v.customCheck and v.customCheck(LocalPlayer())) then t[#t+1] = { v.model, v.name, v.pricesep or "", "/buy " .. v.name } ok = true end end if ok then addList( t ) else ret:Remove() end addLabel( "Ammunition" ) local t = {} for k, v in pairs( GAMEMODE.AmmoTypes ) do if not v.customCheck or v.customCheck(LocalPlayer()) then t[#t+1] = { v.model, v.name, v.price or "", "/buyammo " .. v.ammoType } end end addList( t ) addLabel( "Entities" ) local t = {} for k, v in pairs( DarkRPEntities ) do if not v.allowed or (type(v.allowed) == "table" and table.HasValue(v.allowed, LocalPlayer():Team())) and (not v.customCheck or (v.customCheck and v.customCheck(LocalPlayer()))) then t[#t+1] = { v.model, v.name, v.price or "", v.cmd } end end addList( t ) if FoodItems and (GAMEMODE.Config.foodspawn or LocalPlayer():Team() == TEAM_COOK) and LocalPlayer():Team() == TEAM_COOK then addLabel( "Food" ) local t = {} for k,v in pairs(FoodItems) do t[#t+1] = { v.model, k, "$15", "/buyfood "..k } end addList( t ) end local ok = false local ret = addLabel( "Shipments" ) local t = {} for k, v in pairs( CustomShipments ) do if not GAMEMODE:CustomObjFitsMap(v) then continue end if not v.noship and table.HasValue(v.allowed, LocalPlayer():Team()) and (not v.customCheck or (v.customCheck and v.customCheck(LocalPlayer()))) then t[#t+1] = { v.model, v.name, v.price or "", "/buyshipment "..v.name } ok = true end end if ok then addList( t ) else ret:Remove() end if #CustomVehicles <= 0 then return end local ret = addLabel( "Vehicles" ) local ok = false local t = {} for k, v in pairs( CustomVehicles ) do if (not v.allowed or table.HasValue(v.allowed, LocalPlayer():Team())) and (not v.customCheck or v.customCheck(LocalPlayer())) then local Skin = (list.Get("Vehicles")[v.name] and list.Get("Vehicles")[v.name].KeyValues and list.Get("Vehicles")[v.name].KeyValues.Skin) or "0" t[#t+1] = { v.model or "models/buggy.mdl", v.name, v.price or "", "/buyvehicle "..v.name, Skin } ok = true end end if not ok then ret:Remove() else addList( t ) end end return par end function TabRules() local par = vgui.Create( "DPanelList", F4Menu ) par:SetPos( 5, 65 ) par:SetSize( 490, 430 ) par:SetPadding( 5 ) par:SetSpacing( 5 ) par:EnableVerticalScrollbar( true ) par.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end local text = [[-Rules 1) Respect all our players and staff. We don't appreciate anyone acting like selfish little children. Do not insult your teammates or other players 2) No racism. Racism results in an immediate permanent ban, no exceptions, either OOC or IC. 3) No griefing. Griefing is the act of using or abusing a game mechanic in ways originally unintended. 4) No trolling. Do not even attempt to anger or provoke a specific player. 5) No flaming. Flaming includes, but is not limited to: Ridiculing, insulting or demeaning another member. 6) No advertising. This means do not spread links to other websites/clans or servers other than NVClan. 7) Inappropriate micspam. There is no reason to mic spam, unless you're a radio broadcaster streaming music or talking. 8) Hacking or scripting. Using any exploited programming or software will result in an immediate ban. 9) Vehicles. Using vehicles, you must drive in a sensible way, so no driving over pavements on purpose or trying to run people over. Abusing vehicles results in your vehicles being removed from the database, with no cash refunds. 10) Language. Please speak English ONLY on our server. We have many nationalities, and to make it easier to communicate, English is the set language. -FAQ Q) What do the symbols mean next to the players names on the scoreboard? A) They show what rank that player is. Q) Which symbols represent each rank? A) @user@: User @heart@: Donator @shield@: Admin @shield_add@: Super Admin @award_star_gold_1@: Server Manager @star@: Management Q) Where can I donate? A) Our donate page will be set up soon on our website. For now, contact management if you're interested.]] for k, v in pairs( string.Split( text, "\n" ) ) do if string.Left( v, 1 ) == "@" then local vs, ve = string.find( v, "@[a-z_0-9]*" ) local im = string.sub( v, vs + 1, ve ) local pan = vgui.Create( "DPanel", par ) par:AddItem( pan ) pan.Paint = function( self, w, h ) drawRectMat( 0, 0, 16, 16, "icon16/" .. im .. ".png" ) end pan:SetTall( 16 ) local lab = vgui.Create( "DLabel", pan ) lab:SetText( string.sub( v, ve + 2 ) ) lab:SetExpensiveShadow( 1 ) lab:SetWrap( true ) lab:SetPos( 16, 0 ) lab:SetAutoStretchVertical( true ) lab:SetWide( 470 ) else local lab = vgui.Create( "DLabel", par ) par:AddItem( lab ) -- lab:SetText( v ) lab:SetText( string.Left( v, 1 ) == "-" and string.sub( v, 2 ) or v ) if string.Left( v, 1 ) ~= "-" then lab:SetExpensiveShadow( 1 ) end if string.Left( v, 1 ) == "-" then lab:SetFont( "ChatFont" ) end lab:SetWrap( true ) lab:SetAutoStretchVertical( true ) lab:SetWide( 470 ) end end par.Update = function() end return par end function TabVIP() local par = vgui.Create( "DPanel", F4Menu ) par:SetPos( 5, 65 ) par:SetSize( 490, 430 ) par.Paint = function( self, w, h ) end par.Update = function() end local pan = vgui.Create( "DPanelList", par ) pan:SetPos( 0, 0 ) pan:SetSize( 490, 430 ) pan:SetPadding( 5 ) pan:SetSpacing( 1 ) pan:EnableVerticalScrollbar( true ) pan.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end local text = [[ -Jobs Ninja Radio Broadcaster S.W.A.T Officer S.W.A.T Medic S.W.A.T Chief -Tools Rope Advanced duplicator Lights Lamps Paint Hoverballs Trails Thrusters -Perks $25,000 RPMoney 15% of getting the rare money printer, once upgraded Ability to spawn 1 ragdoll Heart symbol next to your name on the scoreboard Prop limit raised Abusing the commands will result in Donator privileges revokedl]] local s = vgui.Create( "DPanel", pan ) pan:AddItem( s ) s:SetTall( 40 ) s.Paint = function( self, w, h ) drawTextOutlined( "Donate £5 for the following...", "F4.General", w / 2, 15, Color( 0, 246, 230 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) end for k, v in pairs( string.Split( text, "\n" ) ) do local lab = vgui.Create( "DLabel", pan ) pan:AddItem( lab ) lab:SetText( string.Left( v, 1 ) == "-" and string.sub( v, 2 ) or v ) if string.Left( v, 1 ) ~= "-" then lab:SetExpensiveShadow( 1 ) end if string.Left( v, 1 ) == "-" then lab:SetFont( "ChatFont" ) end lab:SetWrap( true ) lab:SetAutoStretchVertical( true ) lab:SetWide( 470 ) end local s = vgui.Create( "DPanel", pan ) pan:AddItem( s ) s:SetTall( 20 ) s.Paint = function() end local but = vgui.Create( "DButton", pan ) pan:AddItem( but ) but:SetTall( 40 ) but:SetText( "" ) but.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 0, 246, 230 ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( "Donate", "F4.GeneralBut", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end but.DoClick = function() gui.OpenURL( "http://www.nvclan.com/" ) end --[[ local pan = vgui.Create( "DPanelList", par ) pan:SetPos( 250, 0 ) pan:SetSize( 240, 430 ) pan:SetPadding( 5 ) pan:SetSpacing( 1 ) pan:EnableVerticalScrollbar( true ) pan.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 80, 80, 80 ), 4 ) end local text = [[Features: - Coming soon to NV]] --[[ local s = vgui.Create( "DPanel", pan ) pan:AddItem( s ) s:SetTall( 40 ) s.Paint = function( self, w, h ) drawTextOutlined( "Coming soon", "F4.General", w / 2, 15, Color( 0, 246, 49 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) end for k, v in pairs( string.Split( text, "\n" ) ) do local lab = vgui.Create( "DLabel", pan ) pan:AddItem( lab ) lab:SetText( string.Left( v, 1 ) == "-" and string.sub( v, 2 ) or v ) if string.Left( v, 1 ) ~= "-" then lab:SetExpensiveShadow( 1 ) end if string.Left( v, 1 ) == "-" then lab:SetFont( "ChatFont" ) end lab:SetWrap( true ) lab:SetAutoStretchVertical( true ) lab:SetWide( 470 ) end local s = vgui.Create( "DPanel", pan ) pan:AddItem( s ) s:SetTall( 20 ) s.Paint = function() end local but = vgui.Create( "DButton", pan ) pan:AddItem( but ) but:SetTall( 40 ) but:SetText( "" ) but.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 0, 246, 49 ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( "Purchase", "F4.GeneralBut", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end but.DoClick = function() gui.OpenURL( "http://www.nvclan.com/" ) end --]] return par end surface.CreateFont( "F4.Title", { size = 18, weight = 700 } ) local F4Up = false if IsValid( F4Menu ) then F4Menu:Remove() end local function ChangeJobVGUI() if not IsValid( F4Menu ) then F4Menu = vgui.Create( "DFrame" ) F4Menu:SetSize( 500, 500 ) F4Menu:Center() F4Menu:SetTitle( "" ) F4Menu:ShowCloseButton( false ) F4Menu:SetVisible( false ) F4Menu:MakePopup() F4Menu.Paint = function( self, w, h ) if input.IsKeyDown( KEY_F4 ) and F4Up then ChangeJobVGUI() elseif not input.IsKeyDown( KEY_F4 ) then F4Up = true end drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 70, 70, 70 ), 4 ) drawGradientCheap( w / 2, h / 2, h - 2, w - 2, Color( 0, 0, 0, 100 ), 90 ) drawRectRounded( 5, 5, w - 35, 20, Color( 0, 0, 0 ), 4 ) drawRectRounded( 6, 6, w - 37, 18, Color( 70, 70, 70 ), 4 ) drawTextOutlined( "NVClan.com - Main Menu", "F4.Title", w / 2 - 12, 15, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) end local close = vgui.Create( "DButton", F4Menu ) close:SetSize( 20, 20 ) close:SetPos( 475, 5 ) close:SetText( "" ) close.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, Color( 70, 70, 70 ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 150, 150, 150 ), 4 ) end drawTextOutlined( "r", "Marlett", w / 2, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end close.DoClick = ChangeJobVGUI F4Menu.tabs = { TabGeneral(), TabJobs(), TabStore(), TabRules(), TabVIP() } for k, v in pairs( F4Menu.tabs ) do v:SetVisible( false ) end F4Menu.tabs[1]:SetVisible( true ) local tabbuts = {} local function addBut( t, m ) local but = vgui.Create( "DButton", F4Menu ) table.insert( tabbuts, but ) but.id = #tabbuts but:SetPos( #tabbuts * 99 - 94, 30 ) but:SetSize( 94, 30 ) but:SetText( "" ) but.Paint = function( self, w, h ) drawRectRounded( 0, 0, w, h, Color( 0, 0, 0 ), 4 ) drawRectRounded( 1, 1, w - 2, h - 2, F4Menu.tabs[ self.id ]:IsVisible() and Color( 70, 170, 200 ) or Color( 70, 70, 70 ), 4 ) if self.Hovered then drawRectRounded( 1, 1, w - 2, h - 2, Color( 255, 255, 255, 50 ), 4 ) end drawTextOutlined( t, "F4.Title", w / 2 + 11, h / 2, Color( 255, 255, 255 ), 0.5, 0.5, 1, Color( 0, 0, 0 ) ) drawRectMat( 7, 7, 16, 16, m ) drawRectRounded( 2, 2, w - 4, h / 2 - 2, Color( 255, 255, 255, 30 ), 4 ) end but.DoClick = function( self ) for k, v in pairs( F4Menu.tabs ) do v:SetVisible( false ) end F4Menu.tabs[ self.id ]:SetVisible( true ) end end addBut( "General", "icon16/user.png" ) addBut( "Jobs", "icon16/user_gray.png" ) addBut( "Store", "icon16/cart.png" ) addBut( "Rules", "icon16/table_error.png" ) addBut( "Donate", "icon16/money.png" ) end F4Menu:SetVisible( not F4Menu:IsVisible() ) F4Up = not F4Menu:IsVisible() for k, v in pairs( F4Menu.tabs ) do v:Update() end end GM.ShowSpare2 = ChangeJobVGUI