Advertisement
TheDenVxUA

Untitled

Aug 5th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 57.37 KB | None | 0 0
  1. AddCSLuaFile()
  2. CreateClientConVar( "agc_key_vehicle", 12 )
  3. CreateClientConVar( "agc_auth_skip", 0 )
  4.  
  5.  
  6. local hasGhomes = file.Exists("autorun/sh_exproperties.lua","LUA") -- dirty
  7.  
  8. --[[-------------------------------------------------------------------------
  9. Material stuff
  10. ---------------------------------------------------------------------------]]
  11. local mat_logo = Material("agc/nsa_logo.png", "alphatest smooth")
  12. local mat_user = Material("icon16/user_suit.png")
  13. local mat_lock = Material("icon16/lock.png")
  14. local mat_terminal = Material("icon16/application_xp_terminal.png")
  15. local mat_exclam = Material("icon16/exclamation.png")
  16. local mat_ano = Material("agc/ano.png", "alphatest smooth")
  17. local mat_cross = Material("icon16/cross.png")
  18. local mat_refresh = Material("icon16/arrow_refresh.png")
  19. local mat_tick = Material("icon16/tick.png")
  20. --[[-------------------------------------------------------------------------
  21. Icon stuff
  22. ---------------------------------------------------------------------------]]
  23. local Icon_Base = {
  24.     {Title = "Жалобы",Icon = "agc/license.png",Action = "2",},
  25.     {Title = "Розыск",Icon = "agc/wanted.png",Action = "3",},
  26.     {Title = "Аресты",Icon = "agc/arrested.png",Action = "4",},
  27.     {Title = "База",Icon = "agc/browser.png",Action = "5",},
  28.     {Title = "Логи",Icon = "agc/complaint.png",Action = "1",},
  29.     {Title = "Настройки",Icon = "agc/settings.png",Action = "6",},
  30. }
  31.  
  32. if hasGhomes then
  33.     table.insert(Icon_Base, {Title = "Имущество",Icon = "agc/complaint.png",Action = "7"})
  34. end
  35.  
  36.  
  37. --[[-------------------------------------------------------------------------
  38. VGUI Stuff
  39. ---------------------------------------------------------------------------]]
  40. local function ErrorFrame( error_message, x, px, py )
  41.     if IsValid(ErrorB) then ErrorB:Remove() end
  42.     ErrorB = vgui.Create( "DFrame" )
  43.     ErrorB:SetSize(x, 30)
  44.     ErrorB:SetPos(px,py)
  45.     ErrorB.Paint = function(self,w,h)
  46.         draw.RoundedBox(8, 0, 0, w, h, Color(15, 15, 15, 200))
  47.         draw.SimpleText( error_message, "AGC_La_22", w / 2, h / 2, color_white, 1, 1 )
  48.         surface.SetDrawColor(color_white)
  49.         surface.SetMaterial(mat_exclam)
  50.         surface.DrawTexturedRect( 7.5, 10, 16, 16)
  51.         surface.SetMaterial(mat_exclam)
  52.         surface.DrawTexturedRect( w - 22.5, 10, 16, 16)
  53.     end
  54.     ErrorB:SetTitle("")
  55.     ErrorB:MakePopup()
  56.     ErrorB:SetDraggable( false )
  57.     ErrorB:ShowCloseButton( false )
  58.     timer.Simple(1.25, function() if IsValid(ErrorB) then ErrorB:Remove() end end)
  59. end
  60.  
  61. local function niceScrollbar(panel)
  62.     panel.VBar.btnUp.Paint = function(self,w,h)
  63.         draw.RoundedBox(0, w * .5-(w / 3.5 / 2) + 5, 0, w / 3.5, h, Color(100, 100, 100))
  64.     end
  65.     panel.VBar.btnDown.Paint = function(self,w,h)
  66.         draw.RoundedBox(0, w * .5-(w / 3.5 / 2) + 5, 0, w / 3.5, h, Color(100, 100, 100))
  67.     end
  68.     panel.VBar.btnGrip.Paint = function(self,w,h)
  69.         draw.RoundedBox(0, w * .5-(w / 3.5 / 2) + 5, 0, w / 3.5, h, Color(180, 180, 180))
  70.     end
  71.     panel.VBar.Paint = function(self,w,h)
  72.         draw.RoundedBox(0, w * .5-( w / 3.5 / 2) + 5, 16, w / 3.5, h-32, Color(120, 120, 120))
  73.     end
  74. end
  75.  
  76. local function AuthFrame(entity_agc)
  77.     local agc_ent = net.ReadEntity() or entity_agc
  78.     if (LocalPlayer():isCP() and GetConVar("agc_auth_skip"):GetInt()) or (isNearAHackedComputer(LocalPlayer()) and not LocalPlayer():isCP()) then
  79.         BaseComputer(agc_ent)
  80.         return
  81.     end
  82.     local passwdenter = false
  83.     local lang_agc = AGC.Language[AGC.MainLanguage]
  84.  
  85.     local BaseAuth = vgui.Create( "DFrame" )
  86.     BaseAuth:SetSize( 600, 600 )
  87.     BaseAuth:SetTitle("")
  88.     BaseAuth:Center()
  89.     BaseAuth:SetDraggable( false )
  90.     BaseAuth:MakePopup()
  91.     BaseAuth:ShowCloseButton( false )
  92.     BaseAuth.Paint = function( self, w, h)
  93.         draw.RoundedBox(4, 1, 1, w - 2, h - 2, Color(80, 80, 80, 255))
  94.         draw.RoundedBox(4, 9, 9, w - 18, h - 18, color_black )
  95.         draw.RoundedBox(4, 10, 10, w - 20, h - 20, Color(150, 150, 150, 255) )
  96.         draw.RoundedBox(2, 260, 115, 330, 75, Color(18, 68, 113, 255) )
  97.         draw.RoundedBox(2, 250, 200, 340, 25, Color(18, 68, 113, 255) )
  98.         draw.SimpleText(lang_agc.Auth_NSA, "AGC_Ge_75", 425, 152, color_white, 1, 1)
  99.         draw.SimpleText(lang_agc.Auth_Desc, "AGC_Ge_15", 425, 210, color_white, 1, 1)
  100.         draw.RoundedBox(6, 125, 300, 350, 240, Color(210, 210, 210, 255))
  101.         surface.SetDrawColor(color_white)
  102.         surface.SetMaterial(mat_logo)
  103.         surface.DrawTexturedRect( 20, 20, 256, 256)
  104.         surface.SetMaterial(mat_user)
  105.         surface.DrawTexturedRect( 385, 365, 20, 20)
  106.         surface.SetMaterial(mat_lock)
  107.         surface.DrawTexturedRect( 385, 430, 20, 20)
  108.         draw.SimpleText(lang_agc.Auth_Login, "AGC_Ge_30", 300, 330, color_black, 1, 1)
  109.     end
  110.  
  111.     local TextName = vgui.Create( "DLabel", BaseAuth )
  112.     TextName:SetPos( 225, 360 )
  113.     TextName:SetSize( 150, 35 )
  114.     TextName:SetText( "" )
  115.     TextName.Paint = function( self, w, h)
  116.         draw.RoundedBox(4, 0, 0, w, h, color_white )
  117.         draw.SimpleText(LocalPlayer():Name(), "AGC_Ge_20", w / 2, h / 2, color_black, 1, 1)
  118.     end
  119.  
  120.     local EntryPassw = vgui.Create( "DTextEntry", BaseAuth )
  121.     EntryPassw:SetPos( 225, 425 )
  122.     EntryPassw:SetSize( 150, 35 )
  123.     EntryPassw:SetText( "" )
  124.     EntryPassw.Paint = function( self, w, h)
  125.         draw.RoundedBox(4, 0, 0, w, h, color_white )
  126.         local oldvalue = self:GetValue()
  127.         local value = string.gsub( oldvalue, ".", "*" )
  128.         draw.SimpleText(value, "AGC_Ge_20", w / 2, h / 2, color_black, 1, 1)
  129.     end
  130.     EntryPassw.OnTextChanged = function()
  131.         passwdenter = true
  132.     end
  133.  
  134.     local BaseExit = vgui.Create( "DButton", BaseAuth )
  135.     BaseExit:SetSize( 150, 35 )
  136.     BaseExit:SetPos( 315, 495 )
  137.     BaseExit:SetText("")
  138.     BaseExit.Paint = function( self, w, h)
  139.         if self.on_cursor_entered then
  140.             draw.RoundedBox(4, 0, 0, w, h, Color(180, 0, 0, 235))
  141.             draw.SimpleText(">>  " .. lang_agc.Button_Disconnect .. "  <<", "AGC_Ge_15", w / 2, h / 2, color_white, 1, 1)
  142.         else
  143.             draw.RoundedBox(4, 0, 0, w, h, Color(180, 0, 0, 200))
  144.             draw.SimpleText(lang_agc.Button_Disconnect, "AGC_Ge_15", w / 2, h / 2, color_white, 1, 1)
  145.         end
  146.     end
  147.     BaseExit.DoClick = function()
  148.         if IsValid(BaseAuth) then BaseAuth:Remove() end
  149.         if IsValid(ErrorB) then ErrorB:Remove() end
  150.     end
  151.  
  152.     local BaseCome = vgui.Create( "DButton", BaseAuth )
  153.     BaseCome:SetSize( 150, 35 )
  154.     BaseCome:SetPos( 135, 495 )
  155.     BaseCome:SetText("")
  156.     BaseCome.Paint = function( self, w, h)
  157.         if self.on_cursor_entered then
  158.             draw.RoundedBox(4, 0, 0, w, h, Color(45, 136, 45, 235))
  159.             draw.SimpleText(">>  " .. lang_agc.Button_Connect .. "  <<", "AGC_Ge_15", w / 2, h / 2, color_white, 1, 1)
  160.         else
  161.             draw.RoundedBox(4, 0, 0, w, h, Color(45, 136, 45, 200))
  162.             draw.SimpleText(lang_agc.Button_Connect, "AGC_Ge_15", w / 2, h / 2, color_white, 1, 1)
  163.         end
  164.     end
  165.     BaseCome.DoClick = function()
  166.         if IsValid(ErrorB) then ErrorB:Remove() end
  167.         if LocalPlayer():isCP() and passwdenter then
  168.             if IsValid(BaseAuth) then BaseAuth:Remove() end
  169.             if IsValid(ErrorB) then ErrorB:Remove() end
  170.             BaseComputer(agc_ent)
  171.             return
  172.         end
  173.         ErrorFrame(lang_agc.Auth_Error, 350, ScrW() / 2 - 175, ScrH() / 2 + 250 )
  174.     end
  175.  
  176.     local ButtonHack = vgui.Create( "DButton", BaseAuth )
  177.     ButtonHack:SetSize( 140, 25 )
  178.     ButtonHack:SetPos( 230, 265 )
  179.     ButtonHack:SetText("")
  180.     if (LocalPlayer():isCP() or (AGC.Hacker_Job and not table.HasValue(AGC.Hacker_Jobname, team.GetName(LocalPlayer():Team()))) or isNearAHackedComputer(LocalPlayer()) or agc_ent:IsVehicle()) then
  181.         ButtonHack:SetVisible(false)
  182.     end
  183.     ButtonHack.Paint = function( self, w, h)
  184.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and color_black or Color(0, 0, 0, 235))
  185.         draw.SimpleText(lang_agc.Attempt_Text, "AGC_Ge_15", w / 2 + 10, h / 2, color_white, 1, 1)
  186.         surface.SetDrawColor(color_white)
  187.         surface.SetMaterial(mat_terminal)
  188.         surface.DrawTexturedRect( 7.5, 5, 16, 16)
  189.     end
  190.     ButtonHack.DoClick = function()
  191.         if IsValid(BaseAuth) then BaseAuth:Remove() end if IsValid(BaseDesktop) then BaseDesktop:Remove() end if IsValid(ErrorB) then ErrorB:Remove() end
  192.         if IsValid(agc_ent) and agc_ent:GetClass() == "apc_computer" then
  193.             net.Start("AGC_Hack")
  194.             net.WriteEntity(agc_ent)
  195.             net.SendToServer()
  196.         end
  197.     end
  198.  
  199.     local CheckB = vgui.Create( "DCheckBoxLabel", BaseAuth )
  200.     CheckB:SetPos( 245, 470 )
  201.     CheckB:SetText( lang_agc.Remember_Log )
  202.     CheckB:SetTextColor( color_black )
  203.     CheckB:SetConVar( "agc_auth_skip" )
  204.     local key_value = GetConVar("agc_auth_skip"):GetInt()
  205.     CheckB:SetValue( key_value )
  206.     CheckB:SizeToContents()
  207.  
  208.     for k,v in pairs(BaseAuth:GetChildren()) do
  209.         if v:GetName() == "DButton" then
  210.             v.OnCursorEntered = function(self)
  211.                 self.on_cursor_entered = true
  212.             end
  213.             v.OnCursorExited = function(self)
  214.                 self.on_cursor_entered = false
  215.             end
  216.         end
  217.     end
  218. end
  219. net.Receive("AuthFrameMenu", AuthFrame)
  220.  
  221. local function AGCLogsFrame(ent)
  222.     local lang_agc = AGC.Language[AGC.MainLanguage]
  223.     local isHacked = isNearAHackedComputer(LocalPlayer())
  224.     local BaseL = vgui.Create( "DFrame" )
  225.     BaseL:SetSize( 700, 675 )
  226.     BaseL:SetTitle("")
  227.     BaseL:Center()
  228.     BaseL:SetDraggable( false )
  229.     BaseL:MakePopup()
  230.     BaseL:ShowCloseButton( false )
  231.     BaseL.Paint = function( self, w, h)
  232.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 240))
  233.         draw.SimpleText(lang_agc.LogsTitle, "AGC_Ta_17", 15, 15, color_white, 0, 1)
  234.         draw.SimpleText(lang_agc.LogsDesc, "AGC_Ta_16", 15, 32.5, color_white, 0, 1)
  235.  
  236.         draw.SimpleText(lang_agc.ArrestInfo, "AGC_Hack_25", 15, 60, color_white, 0, 1)
  237.         draw.SimpleText(lang_agc.Unarrest, "AGC_Hack_25", 360, 60, color_white, 0, 1)
  238.         draw.SimpleText(lang_agc.WantedInfo, "AGC_Hack_25", 15, 275, color_white, 0, 1)
  239.         draw.SimpleText(lang_agc.Unwanted, "AGC_Hack_25", 360, 275, color_white, 0, 1)
  240.         draw.SimpleText(lang_agc.LastWarrants, "AGC_Hack_25", 15, 490, color_white, 0, 1)
  241.  
  242.         draw.RoundedBox(2, 10, 75, w / 2 - 20, 2, Color(200, 0, 0, 240))
  243.         draw.RoundedBox(2, w / 2 + 10, 75, w / 2 - 20, 2, Color(0, 180, 0, 240))
  244.         draw.RoundedBox(2, 10, 290, w / 2 - 20, 2, Color(200, 0, 0, 240))
  245.         draw.RoundedBox(2, w / 2 + 10, 290, w / 2 - 20, 2, Color(0, 180, 0, 240))
  246.         draw.RoundedBox(2, 10, 505, w - 20, 2, Color(50, 50, 200, 240))
  247.     end
  248.  
  249.     local ExitB = vgui.Create( "DButton", BaseL )
  250.     ExitB:SetPos( 663, 10 )
  251.     ExitB:SetText( "" )
  252.     ExitB:SetSize( 26, 26 )
  253.     ExitB.Paint = function( self, w, h )
  254.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  255.         surface.SetDrawColor(color_white)
  256.         surface.SetMaterial(mat_cross)
  257.         surface.DrawTexturedRect( 5, 5, 16, 16)
  258.         if self.on_cursor_entered then
  259.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  260.         end
  261.     end
  262.     ExitB.DoClick = function()
  263.         if IsValid(BaseL) then BaseL:Remove() end
  264.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  265.     end
  266.  
  267.     local ArrestList = vgui.Create( "DListView", BaseL)
  268.     ArrestList:SetPos( 10, 85)
  269.     ArrestList:SetSize( 330, 175)
  270.     ArrestList:AddColumn( lang_agc.Criminal ):SetFixedWidth( 120 )
  271.     ArrestList:AddColumn( lang_agc.Time ):SetFixedWidth( 90 )
  272.     ArrestList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth( 120 )
  273.     ArrestList:SetTooltip(lang_agc.ArrestInfoTip)
  274.  
  275.     local UnArrestList = vgui.Create( "DListView", BaseL)
  276.     UnArrestList:SetPos( 360, 85)
  277.     UnArrestList:SetSize( 330, 175)
  278.     UnArrestList:AddColumn( lang_agc.Criminal ):SetFixedWidth( 220 )
  279.     UnArrestList:AddColumn( lang_agc.UnarrestDate ):SetFixedWidth( 110 )
  280.     UnArrestList:SetTooltip(lang_agc.UnArrestInfo)
  281.  
  282.     local WantedList = vgui.Create( "DListView", BaseL)
  283.     WantedList:SetPos( 10, 300)
  284.     WantedList:SetSize( 330, 175)
  285.     WantedList:AddColumn( lang_agc.Criminal ):SetFixedWidth( 110 )
  286.     WantedList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth( 110 )
  287.     WantedList:AddColumn( lang_agc.Case_Entry ):SetFixedWidth( 110 )
  288.     WantedList:SetTooltip(lang_agc.WantedToolTip)
  289.  
  290.     local UnWantedList = vgui.Create( "DListView", BaseL)
  291.     UnWantedList:SetPos( 360, 300)
  292.     UnWantedList:SetSize( 330, 175)
  293.     UnWantedList:AddColumn( lang_agc.Criminal ):SetFixedWidth( 120 )
  294.     UnWantedList:AddColumn( lang_agc.UnwantedDate ):SetFixedWidth( 90 )
  295.     UnWantedList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth( 120 )
  296.     UnWantedList:SetTooltip(lang_agc.UnWantedInfo)
  297.  
  298.     local WarrantList = vgui.Create( "DListView", BaseL)
  299.     WarrantList:SetPos( 10, 515)
  300.     WarrantList:SetSize( 680, 150)
  301.     WarrantList:AddColumn( lang_agc.Criminal ):SetFixedWidth( 150 )
  302.     WarrantList:AddColumn( lang_agc.Case_Entry ):SetFixedWidth( 300 )
  303.     WarrantList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth( 150 )
  304.     WarrantList:AddColumn( lang_agc.Case_Date ):SetFixedWidth( 80 )
  305.     WarrantList:SetTooltip(lang_agc.WarrantInfo)
  306.     local tt = {["arrest"] = ArrestList, ["unarrested"] = UnArrestList, ["wanted"] = WantedList, ["unwanted"] = UnWantedList, ["warrant"] = WarrantList }
  307.     local data = {}
  308.     net.Start( "AGCLogsGet" )
  309.     net.WriteString("")
  310.     net.SendToServer()
  311.     net.Receive( "AGCLogsSend", function()
  312.         local arrI = net.ReadTable()
  313.         data = arrI
  314.         for _, l in pairs(arrI.arrest) do
  315.             for k, b in pairs(l) do ArrestList:AddLine( b[1], b[3] .. " " .. lang_agc.Hack_Seconds, b[2], k, _) end
  316.         end
  317.         for _, l in pairs(arrI.unarrested) do
  318.             for k, b in pairs(l) do UnArrestList:AddLine( b[1], os.date("%d/%m - %H:%M", b[2]), k, _) end
  319.         end
  320.         for _, l in pairs(arrI.unwanted) do
  321.             for k, b in pairs(l) do UnWantedList:AddLine( b[1], os.date("%d/%m - %H:%M", b[3]), b[2], k, _) end
  322.         end
  323.         for _, l in pairs(arrI.wanted) do
  324.             for k, b in pairs(l) do WantedList:AddLine( b[1], b[2], b[3], k, _) end
  325.         end
  326.         for _, l in pairs(arrI.warrant) do
  327.             for k, b in pairs(l) do WarrantList:AddLine( b[1], b[3], b[2], os.date("%d/%m - %H:%M", b[4]), k, _) end
  328.         end
  329.     end)
  330.     for k,v in pairs(tt) do
  331.         v:SetMultiSelect( false )
  332.         niceScrollbar(v)
  333.  
  334.         v.OnRowRightClick = function(self, row)
  335.             local selectact = DermaMenu()
  336.             selectact:AddOption( lang_agc.delete_entry, function()
  337.                 if IsValid(ErrorB) then ErrorB:Remove() end
  338.                 if not table.HasValue(AGC.DeleteLogs, team.GetName(LocalPlayer():Team())) and not isHacked then
  339.                     ErrorFrame(lang_agc.not_allowed, 390, ScrW() / 2 - 175, 125)
  340.                     return
  341.                 end
  342.                 local sid, id = v:GetLine(row):GetValue(table.Count(v:GetLine(row).Columns)), v:GetLine(row):GetValue(table.Count(v:GetLine(row).Columns) - 1)
  343.                 net.Start("DeleteLogs")
  344.                 net.WriteTable({k, sid, data[k][sid][id]})
  345.                 net.SendToServer()
  346.                 self:RemoveLine(row)
  347.                 ErrorFrame(lang_agc.delete_success, 350, ScrW() / 2 - 175, 125)
  348.             end)
  349.             :SetIcon("icon16/database_delete.png")
  350.             selectact:Open()
  351.         end
  352.     end
  353.  
  354.     local RefreshB = vgui.Create( "DButton", BaseL )
  355.     RefreshB:SetPos( 630, 10 )
  356.     RefreshB:SetText( "" )
  357.     RefreshB:SetSize( 26, 26 )
  358.     RefreshB.Paint = function( self, w, h )
  359.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  360.         surface.SetDrawColor(color_white)
  361.         surface.SetMaterial(mat_refresh)
  362.         surface.DrawTexturedRect( 5, 5, 16, 16)
  363.         if self.on_cursor_entered then
  364.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  365.         end
  366.     end
  367.     RefreshB.DoClick = function()
  368.         for _,v in pairs(tt) do
  369.             v:Clear()
  370.         end
  371.         net.Start( "AGCLogsGet" )
  372.         net.WriteString("")
  373.         net.SendToServer()
  374.         net.Receive( "AGCLogsSend", function()
  375.             local arrI = net.ReadTable()
  376.             data = arrI
  377.             for _, l in pairs(arrI.arrest) do
  378.                 for k, b in pairs(l) do ArrestList:AddLine( b[1], b[3] .. " " .. lang_agc.Hack_Seconds, b[2], k, _) end
  379.             end
  380.             for _, l in pairs(arrI.unarrested) do
  381.                 for k, b in pairs(l) do UnArrestList:AddLine( b[1], os.date("%d/%m - %H:%M", b[2]), k, _) end
  382.             end
  383.             for _, l in pairs(arrI.unwanted) do
  384.                 for k, b in pairs(l) do UnWantedList:AddLine( b[1], os.date("%d/%m - %H:%M", b[3]), b[2], k, _) end
  385.             end
  386.             for _, l in pairs(arrI.wanted) do
  387.                 for k, b in pairs(l) do WantedList:AddLine( b[1], b[2], b[3], k, _) end
  388.             end
  389.             for _, l in pairs(arrI.warrant) do
  390.                 for k, b in pairs(l) do WarrantList:AddLine( b[1], b[3], b[2], os.date("%d/%m - %H:%M", b[4]), k, _) end
  391.             end
  392.         end)
  393.     end
  394.  
  395.     for k,v in pairs(BaseL:GetChildren()) do
  396.         if v:GetName() == "DButton" then
  397.             v.OnCursorEntered = function(self)
  398.                 self.on_cursor_entered = true
  399.             end
  400.             v.OnCursorExited = function(self)
  401.                 self.on_cursor_entered = false
  402.             end
  403.         end
  404.     end
  405. end
  406.  
  407.  
  408. local function CmdMenu( title, desc, cmd, plyc, type)
  409.     local lang_agc = AGC.Language[AGC.MainLanguage]
  410.     local BaseCmd = vgui.Create( "DFrame" )
  411.     BaseCmd:SetSize( 390 , 190)
  412.     BaseCmd:SetTitle("")
  413.     BaseCmd:Center()
  414.     BaseCmd:SetDraggable( false )
  415.     BaseCmd:MakePopup()
  416.     BaseCmd:ShowCloseButton( false )
  417.     BaseCmd.Paint = function( self, w, h)
  418.         draw.RoundedBox(4, 0, 0, w, h, color_black )
  419.         draw.RoundedBox(4, 1, 1, w - 2, h - 2, Color(50, 50, 50, 255) )
  420.  
  421.         draw.RoundedBox(4, 9, 9, w - 18, h - 18, color_black)
  422.         draw.RoundedBox(4, 10, 10, w - 20, h - 20, Color(20, 20, 20, 255))
  423.  
  424.         draw.SimpleText( title, "AGC_Bu_20", w / 2, 30, color_white, 1, 1)
  425.         draw.SimpleText( desc, "AGC_Bu_17", 200, 50, color_white, 1, 1)
  426.         draw.SimpleText("C:/Police/>", "BudgetLabel", 10, 10, Color(255, 255, 255, 10))
  427.     end
  428.  
  429.     local ExitB = vgui.Create( "DButton", BaseCmd )
  430.     ExitB:SetSize( 100, 35 )
  431.     ExitB:SetPos( 250, 125 )
  432.     ExitB:SetText("")
  433.     ExitB.Paint = function( self, w, h)
  434.         draw.RoundedBox(2, 0, 0, w, h, Color(180, 0, 0, 225))
  435.         draw.SimpleText(lang_agc.Button_Cancel, "BudgetLabel", w / 2, h / 2, color_white, 1, 1)
  436.     end
  437.     ExitB.DoClick = function()
  438.         if IsValid(BaseCmd) then BaseCmd:Remove() end
  439.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  440.     end
  441.  
  442.     local select_plyc = vgui.Create( "DComboBox", BaseCmd )
  443.     select_plyc:SetPos(237.5, 80)
  444.     select_plyc:SetSize(125, 20)
  445.     for _,v in pairs( player.GetAll() ) do
  446.         if type == "1" then
  447.             if v:isWanted() then
  448.                 select_plyc:AddChoice( v:Name())
  449.             end
  450.         elseif type == "2" then
  451.             if not v:isWanted() then
  452.                 select_plyc:AddChoice( v:Name())
  453.             end
  454.         else
  455.             select_plyc:AddChoice( v:Name())
  456.         end
  457.     end
  458.     select_plyc.OnSelect = function( panel, index, value, data)
  459.         choice = string.Explode( " ", value)[1]
  460.     end
  461.  
  462.     local EntryArg = vgui.Create( "DTextEntry", BaseCmd )
  463.     EntryArg:SetPos( 40, 75 )
  464.     EntryArg:SetText( "" )
  465.     EntryArg:SetSize( 175, 30 )
  466.     EntryArg.Paint = function( self, w, h)
  467.         draw.RoundedBox(4, 0, 0, w, h, color_white)
  468.         draw.SimpleText(self:GetValue(), "AGC_Bu_17", w / 2, h / 2, color_black, 1, 1)
  469.         self:DrawTextEntryText(color_black, self.m_colHighlight, color_black)
  470.     end
  471.  
  472.     if plyc == "1" then
  473.         EntryArg:SetSize( 185, 30 )
  474.     elseif plyc == "2" then
  475.         EntryArg:SetSize( 185, 30 )
  476.     else
  477.         if IsValid(select_plyc) then select_plyc:Remove() end
  478.         EntryArg:SetSize( 310, 30 )
  479.     end
  480.  
  481.     local SendB = vgui.Create( "DButton", BaseCmd )
  482.     SendB:SetSize( 100, 35 )
  483.     SendB:SetPos( 40, 125 )
  484.     SendB:SetText("")
  485.     SendB.Paint = function( self, w, h)
  486.         draw.RoundedBox(2, 0, 0, w, h, Color(0, 80, 0, 225))
  487.         draw.SimpleText(lang_agc.Button_Send, "BudgetLabel", w / 2, h / 2, color_white, 1, 1)
  488.     end
  489.     SendB.DoClick = function()
  490.         local value = EntryArg:GetValue()
  491.         if value or choice then
  492.             if plyc == "1" and choice and value then
  493.                 net.Start(cmd)
  494.                 net.WriteString(choice)
  495.                 net.WriteString(value)
  496.                 net.SendToServer()
  497.             elseif plyc == "2" and choice then
  498.                 net.Start(cmd)
  499.                 net.WriteString(choice)
  500.                 net.SendToServer()
  501.             elseif value then
  502.                 LocalPlayer():ConCommand("say " .. cmd .. " " .. value)
  503.             end
  504.         end
  505.         if IsValid(BaseCmd) then BaseCmd:Remove() end
  506.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  507.     end
  508. end
  509.  
  510. local function ArrWanFrame(mode)
  511.     local lang_agc = AGC.Language[AGC.MainLanguage]
  512.     local title = mode and lang_agc.Wanted_Title or lang_agc.Arrest_Title
  513.     local desc = mode and lang_agc.Wanted_Desc or lang_agc.Arrest_Desc
  514.     local info = mode and lang_agc.Info_NWanted or lang_agc.Info_NArrested
  515.  
  516.     local BaseWF = vgui.Create( "DFrame" )
  517.     BaseWF:SetSize( 540, 475 )
  518.     BaseWF:SetTitle("")
  519.     BaseWF:Center()
  520.     BaseWF:SetDraggable( false )
  521.     BaseWF:MakePopup()
  522.     BaseWF:ShowCloseButton( false )
  523.     BaseWF.Paint = function( self, w, h)
  524.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 240))
  525.         draw.SimpleText(title, "AGC_Ta_17", 15, 15, color_white, 0, 1)
  526.         draw.SimpleText(desc, "AGC_Ta_16", 15, 32.5, color_white, 0, 1)
  527.     end
  528.  
  529.     local vide = true
  530.     local BaseWanted = vgui.Create( "DPanelList", BaseWF )
  531.     BaseWanted:SetPos(10, 60)
  532.     BaseWanted:SetSize( 520 , 405)
  533.     BaseWanted:EnableVerticalScrollbar( true )
  534.     BaseWanted.Paint = function(self, w, h)
  535.         draw.RoundedBox(6, 0, 0, w, h, Color(255, 255, 255, 150))
  536.         if vide then
  537.             draw.SimpleText(info, "AGC_Ge_30", w / 2, 40, color_black, 1, 1)
  538.         end
  539.     end
  540.  
  541.     local infoo, random_v = mode and lang_agc.WantedInfo or lang_agc.ArrestInfo, math.random(100, 300)
  542.     for k,v in pairs( player.GetAll() ) do
  543.         if mode and v:isWanted() or v:isArrested() then
  544.             local BaseDrawWan = vgui.Create( "DPanel", BaseWanted )
  545.             BaseDrawWan:SetSize( 340 , 74)
  546.             BaseDrawWan:SetPos( 0, 0 )
  547.             BaseDrawWan:SetTooltip( v:isWanted() and v.DarkRPVars.wantedReason or "" )
  548.             BaseDrawWan.Paint = function(self, w, h)
  549.                 draw.RoundedBox(0, 0, 0, w, h, Color(180, 180, 180, 225))
  550.                 draw.RoundedBox(0, 5, 5, w - 10, h - 10, Color(255, 180, 100, 100))
  551.  
  552.                 surface.SetDrawColor( color_black )
  553.                 surface.DrawOutlinedRect( 0, 0, w, h )
  554.                 surface.SetDrawColor( color_black ) -- {{ user_id }
  555.                 surface.DrawOutlinedRect( 5, 5, w - 10, h - 10 )
  556.                 draw.SimpleText(v:Name(), "AGC_Ge_30", 80, 25, Color(0, 0 ,0), 0, 1)
  557.                 draw.SimpleText(v.DarkRPVars.job, "AGC_Ge_20", 80, 45, Color(0, 0 ,0), 0, 1)
  558.                 draw.SimpleText(infoo .. " #2" .. random_v .. k, "HudSelectionText", w - 10, 15, Color(0, 0 ,0), 2, 1)
  559.             end
  560.             local SpawnI = vgui.Create( "SpawnIcon" , BaseDrawWan )
  561.             SpawnI:SetPos( 5, 5 )
  562.             SpawnI:SetSize( 64, 64 )
  563.             SpawnI:SetModel( v:GetModel() )
  564.             SpawnI:SetTooltip( v:isWanted() and v.DarkRPVars.wantedReason or "" )
  565.  
  566.             if mode then
  567.                 local IconExit = vgui.Create( "DButton", BaseDrawWan )
  568.                 IconExit:SetSize( 50, 25 )
  569.                 IconExit:SetPos( 445, 30 )
  570.                 IconExit:SetText("")
  571.                 IconExit:SetTooltip( "Unwanted" )
  572.                 IconExit.Paint = function( self, w, h)
  573.                     if self.on_cursor_entered then
  574.                         draw.RoundedBox(4, 0, 0, w, h, Color(110, 0, 0, 255))
  575.                     else
  576.                         draw.RoundedBox(4, 0, 0, w, h, Color(110, 0, 0, 225))
  577.                     end
  578.                     draw.SimpleText("Удалить", "AGC_Ta_16", w / 2, h / 2, color_white, 1, 1)
  579.                 end
  580.                 IconExit.DoClick = function()
  581.                     if IsValid(ErrorB) then ErrorB:Remove() end
  582.                     net.Start("AGC_Unwanted")
  583.                     net.WriteString(v:Name())
  584.                     net.SendToServer()
  585.                     ErrorFrame( v:Name() .. " " .. lang_agc.Wanted_Unwanted, 475, ScrW() / 2 - 235, ScrH() / 2 - 275 )
  586.                     if IsValid(BaseWF) then BaseWF:Remove() end
  587.                     timer.Simple(0.1, function() ArrWanFrame() end)
  588.                 end
  589.                 IconExit.OnCursorEntered = function( self )
  590.                     self.on_cursor_entered = true
  591.                 end
  592.                 IconExit.OnCursorExited = function( self )
  593.                     self.on_cursor_entered = false
  594.                 end
  595.             end
  596.             BaseWanted:AddItem( BaseDrawWan )
  597.             vide = false
  598.         end
  599.     end
  600.  
  601.     local RefreshB = vgui.Create( "DButton", BaseWF )
  602.     RefreshB:SetPos( 467, 10 )
  603.     RefreshB:SetText( "" )
  604.     RefreshB:SetSize( 26, 26 )
  605.     RefreshB.Paint = function( self, w, h ) -- {{ user_id }
  606.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  607.         surface.SetDrawColor(color_white)
  608.         surface.SetMaterial(mat_refresh)
  609.         surface.DrawTexturedRect( 5, 5, 16, 16)
  610.         if self.on_cursor_entered then
  611.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  612.         end
  613.     end
  614.     RefreshB.DoClick = function()
  615.         if IsValid(BaseWF) then BaseWF:Remove() end
  616.         timer.Simple(0.1, function() ArrWanFrame() end)
  617.     end
  618.  
  619.     local ExitB = vgui.Create( "DButton", BaseWF )
  620.     ExitB:SetPos( 500, 10 )
  621.     ExitB:SetText( "" )
  622.     ExitB:SetSize( 26, 26 )
  623.     ExitB.Paint = function( self, w, h )
  624.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  625.         surface.SetDrawColor(color_white)
  626.         surface.SetMaterial(mat_cross)
  627.         surface.DrawTexturedRect( 5, 5, 16, 16)
  628.         if self.on_cursor_entered then
  629.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  630.         end
  631.     end
  632.     ExitB.DoClick = function()
  633.         if IsValid(BaseWF) then BaseWF:Remove() end
  634.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  635.     end
  636.     for k,v in pairs(BaseWF:GetChildren()) do
  637.         if v:GetName() == "DButton" then
  638.             v.OnCursorEntered = function(self)
  639.                 self.on_cursor_entered = true
  640.             end
  641.             v.OnCursorExited = function(self)
  642.                 self.on_cursor_entered = false
  643.             end
  644.         end
  645.     end
  646. end
  647.  
  648. local function SettingsFrame(ent)
  649.     local lang_agc = AGC.Language[AGC.MainLanguage]
  650.     local BaseSe = vgui.Create( "DFrame" )
  651.     BaseSe:SetSize( 425, 80 )
  652.     BaseSe:SetTitle("")
  653.     BaseSe:SetPos(ScrW() * .5 - (BaseSe:GetWide() / 2), ScrH() * .25)
  654.     BaseSe:SetDraggable( false )
  655.     BaseSe:MakePopup()
  656.     BaseSe:ShowCloseButton( false )
  657.     BaseSe.Paint = function( self, w, h)
  658.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 240))
  659.         draw.SimpleText(lang_agc.Settings_Title, "AGC_Ta_17", 15, 15, color_white, 0, 1)
  660.         draw.SimpleText(lang_agc.Settings_Desc, "AGC_Ta_16", 15, 32.5, color_white, 0, 1)
  661.  
  662.         draw.SimpleText(lang_agc.Settings_Wall, "AGC_Ta_16", 120, 60, color_white, 0, 1)
  663.         draw.SimpleText("Remember my login", "AGC_Ta_16", 260, 60, color_white, 0, 1)
  664.     end
  665.  
  666.     local files = file.Find( "backgrounds/*.jpg", "GAME" )
  667.     local ChooseBG = vgui.Create( "DComboBox", BaseSe )
  668.     ChooseBG:SetPos( 15, 50 )
  669.     ChooseBG:SetSize( 100, 20 )
  670.     ChooseBG:SetValue( ent:GetClass() == "apc_computer" and ent:GetWallpaper() or "georgeebizzle_welcome_to_city17_its_safer_here" )
  671.     for k,v in pairs(files) do
  672.         ChooseBG:AddChoice(string.gsub(tostring(v), ".jpg", "") )
  673.     end
  674.     ChooseBG.OnSelect = function( panel, index, value )
  675.         value = value .. ".jpg"
  676.         if IsValid(ent) then
  677.             if ent:GetClass() == "apc_computer" then ent:SetWallpaper(value) end
  678.             if IsValid(BaseDesktop) then
  679.                 BaseDesktop.mat_wallpaper = Material("backgrounds/" .. (ent:GetClass() == "apc_computer" and ent:GetWallpaper() or value))
  680.             end
  681.         end
  682.     end
  683.  
  684.     local ExitB = vgui.Create( "DButton", BaseSe )
  685.     ExitB:SetPos( 390, 10 )
  686.     ExitB:SetText( "" )
  687.     ExitB:SetSize( 26, 26 )
  688.     ExitB.Paint = function( self, w, h )
  689.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  690.         surface.SetDrawColor(color_white)
  691.         surface.SetMaterial(mat_cross)
  692.         surface.DrawTexturedRect( 5, 5, 16, 16)
  693.         if self.on_cursor_entered then
  694.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  695.         end
  696.     end
  697.     ExitB.DoClick = function()
  698.         if IsValid(BaseSe) then BaseSe:Remove() end
  699.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  700.     end
  701.  
  702.     ExitB.OnCursorEntered = function( self )
  703.         self.on_cursor_entered = true
  704.     end
  705.     ExitB.OnCursorExited = function( self )
  706.         self.on_cursor_entered = false
  707.     end
  708.  
  709.     local CheckB = vgui.Create( "DCheckBox", BaseSe )
  710.     CheckB:SetPos( 240, 52.5 )
  711.     CheckB:SetConVar( "agc_auth_skip" )
  712.     local key_value = GetConVar("agc_auth_skip"):GetInt()
  713.     CheckB:SetValue( key_value )
  714. end
  715.  
  716. local function _ghomes_lister()
  717.     local coowner = "Сожитель"
  718.     local owner = "Владелец"
  719.  
  720.     local BaseC = vgui.Create( "DFrame" )
  721.     BaseC:SetSize( 600, 515 )
  722.     BaseC:SetTitle("")
  723.     BaseC:Center()
  724.     BaseC:SetDraggable( false )
  725.     BaseC:MakePopup()
  726.     BaseC:ShowCloseButton( false )
  727.     BaseC.Paint = function( self, w, h)
  728.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 240))
  729.         draw.SimpleText("Имущество жителей Los Angeles ", "AGC_Ta_17", 15, 15, color_white, 0, 1)
  730.         draw.SimpleText("Список недвижимости", "AGC_Ta_16", 15, 32.5, color_white, 0, 1)
  731.     end
  732.  
  733.  
  734.     local CaseList = vgui.Create( "DListView", BaseC )
  735.     CaseList:SetPos( 10, 100)
  736.     CaseList:SetSize(  BaseC:GetWide()-20, 405)
  737.     CaseList:SetMultiSelect( false )
  738.     CaseList:AddColumn("Имя"):SetFixedWidth( 300 )
  739.     CaseList:AddColumn("Статус"):SetFixedWidth( 150 )
  740.     CaseList:AddColumn("Онлайн"):SetFixedWidth( 130 )
  741.  
  742.  
  743.     local dcomboHomesList = vgui.Create( "DComboBox",  BaseC )
  744.     dcomboHomesList:SetPos( 10, 50 )
  745.     dcomboHomesList:SetSize( 100, 20 )
  746.     dcomboHomesList:SetValue( "Выберите дом" )
  747.     for k, v in pairs (ghomes.list) do
  748.         if not v.isrented then continue end
  749.         dcomboHomesList:AddChoice( v.name, k )
  750.     end
  751.     dcomboHomesList.OnSelect = function( panel, index, value, data )
  752.         CaseList:Clear()
  753.         LocalPlayer():ChatPrint("reee")
  754.         if not ghomes.list[data] then return end
  755.         local house = ghomes.list[data]
  756.         LocalPlayer():ChatPrint("reee2")
  757.         CaseList:AddLine(house.ownername, owner, house.owner and "true" or "false")
  758.         LocalPlayer():ChatPrint("reee3")
  759.        
  760.         for k, v in pairs(house.friendsname) do
  761.             local ply = player.GetBySteamID( house.friends[k] )
  762.             CaseList:AddLine(v, coowner, ply and "true" or "false")
  763.         end
  764.  
  765.  
  766.  
  767.  
  768.     end
  769.  
  770.  
  771.     local ExitB = vgui.Create( "DButton", BaseC )
  772.     ExitB:SetPos( BaseC:GetWide()-37, 10 )
  773.     ExitB:SetText( "" )
  774.     ExitB:SetSize( 26, 26 )
  775.     ExitB.Paint = function( self, w, h )
  776.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  777.         surface.SetDrawColor(color_white)
  778.         surface.SetMaterial(mat_cross)
  779.         surface.DrawTexturedRect( 5, 5, 16, 16)
  780.         if self.on_cursor_entered then
  781.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  782.         end
  783.     end
  784.     ExitB.DoClick = function()
  785.         if IsValid(BaseC) then BaseC:Remove() end
  786.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  787.     end
  788. end
  789.  
  790.  
  791. surface.CreateFont( "AGC_CaseFA", { font = "Lato", size = 20, weight = 500, } )
  792. surface.CreateFont( "AGC_CaseFB", { font = "Lato", size = 15, weight = 500, } )
  793. surface.CreateFont( "AGC_CaseFC", { font = "Lato", size = 35, weight = 500, } )
  794. surface.CreateFont( "AGC_CaseFD", { font = "Roboto", size = 20, weight = 500, } )
  795.  
  796. local function caseFrame(v)
  797.     if not IsValid(v) or not v:IsPlayer() then
  798.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  799.         return
  800.     end
  801.     local lang_agc = AGC.Language[AGC.MainLanguage]
  802.  
  803.     local BaseC = vgui.Create("DFrame")
  804.     BaseC:SetSize(570, 270)
  805.     BaseC:SetTitle("")
  806.     BaseC:Center()
  807.     BaseC:SetDraggable(false)
  808.     BaseC:MakePopup()
  809.     BaseC:ShowCloseButton(false)
  810.     BaseC.Paint = function( self, w, h)
  811.         if not IsValid(v) or not IsValid(BaseC) then BaseC:Remove() return end
  812.         draw.RoundedBox(0, 0, 44, w, h - 44, Color(40, 50, 60, 255))
  813.         draw.RoundedBox(0, 0, 0, w, 44, Color(0, 0, 0, 200))
  814.         surface.SetDrawColor( color_black )
  815.         surface.DrawOutlinedRect( 0, 0, w, 44 )
  816.         draw.SimpleText( v:Name() or "Unknown", "AGC_CaseFB", 40, 15, color_white, 0, 1 )
  817.         draw.SimpleText( v.DarkRPVars.job or "Unknown", "AGC_CaseFB", 40, 30, color_white, 0, 1 )
  818.         draw.RoundedBox( 0, 15, 60, w / 2 - 45, 85, color_white)
  819.         surface.SetDrawColor( Color( 120, 120, 120, 255 ) )
  820.         surface.DrawOutlinedRect( 15, 60, w / 2 - 44, 85 )
  821.  
  822.         draw.SimpleText( lang_agc.driver_li .. ":", "AGC_CaseFD", 20, 72, color_black, 0, 1 )
  823.         local bl = AGC.DriverLicenseEnabled and AGC.DriverLicenseFunction(v) or false
  824.         draw.SimpleText( AGC.DriverLicenseEnabled and (bl and "V" or "X") or lang_agc.Unknown, "AGC_CaseFD", 175, 72, bl and Color(0,160,0) or Color(200,0,0), 0, 1 )
  825.  
  826.         draw.SimpleText( lang_agc.gun_li .. ":", "AGC_CaseFD", 20, 92, color_black, 0, 1 )
  827.         bl = v:getDarkRPVar("HasGunlicense")
  828.         draw.SimpleText( bl and "V" or "X", "AGC_CaseFD", 175, 92, bl and Color(0,160,0) or Color(200,0,0), 0, 1 )
  829.  
  830.         bl = v:isWanted()
  831.         draw.SimpleText( "Wanted:", "AGC_CaseFD", 20, 112, color_black, 0, 1 )
  832.         draw.SimpleText( bl and "V" or "X", "AGC_CaseFD", 175, 112, bl and Color(0,160,0) or Color(200,0,0), 0, 1 )
  833.  
  834.         bl = v:isArrested()
  835.         draw.SimpleText( "Arrested:", "AGC_CaseFD", 20, 132, color_black, 0, 1 )
  836.         draw.SimpleText( bl and "V" or "X", "AGC_CaseFD", 175, 132, bl and Color(0,160,0) or Color(200,0,0), 0, 1 )
  837.     end
  838.  
  839.     local plyIcon = vgui.Create( "SpawnIcon" , BaseC )
  840.     plyIcon:SetSize( 42, 42 )
  841.     plyIcon:SetPos( 0, 1 )
  842.     plyIcon:SetModel( v:GetModel() )
  843.     plyIcon:SetTooltip( v:Name() or "Unknown" )
  844.  
  845.     local ArrestList = vgui.Create( "DListView", BaseC )
  846.     ArrestList:SetSize( 275, 85 )
  847.     ArrestList:SetPos( 280, 60 )
  848.     ArrestList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth( 100 )
  849.     ArrestList:AddColumn( lang_agc.Time ):SetFixedWidth( 75 )
  850.     ArrestList:AddColumn( "Date" ):SetFixedWidth( 100 )
  851.  
  852.     local WantedList = vgui.Create( "DListView", BaseC )
  853.     WantedList:SetSize( 540, 100 )
  854.     WantedList:SetPos( 15, 155 )
  855.     WantedList:SetMultiSelect( false )
  856.     WantedList:AddColumn( "Type" ):SetFixedWidth(75)
  857.     WantedList:AddColumn( lang_agc.PoliceOfficer ):SetFixedWidth(125)
  858.     WantedList:AddColumn( lang_agc.Case_Entry )
  859.  
  860.     for _,l in pairs({ArrestList, WantedList}) do
  861.         l:SetMultiSelect( false )
  862.         niceScrollbar(l)
  863.     end
  864.  
  865.     net.Start( "AGCLogsGet" )
  866.     net.WriteString(v:SteamID64() or "90071996842377216")
  867.     net.SendToServer()
  868.     net.Receive( "AGCLogsSend", function()
  869.         if IsValid(v) then
  870.             local arrI = net.ReadTable()
  871.             for __, arr in pairs(arrI.a) do
  872.                 ArrestList:AddLine( arr[2], arr[3] .. " " .. lang_agc.Hack_Seconds, os.date("%d/%m", arr[4]))
  873.             end
  874.             for __, arr in pairs(arrI.b) do
  875.                 WantedList:AddLine(lang_agc.WantedInfo, arr[2], arr[3])
  876.             end
  877.             for __, arr in pairs(arrI.c) do
  878.                 WantedList:AddLine(lang_agc.Warrant, arr[2], arr[3])
  879.             end
  880.         end
  881.     end)
  882.  
  883.     local WantedB = vgui.Create( "DButton", BaseC )
  884.     WantedB:SetSize( 130, 25 )
  885.     WantedB:SetPos( 170, 10 )
  886.     WantedB:SetText("")
  887.     WantedB.Paint = function( self, w, h)
  888.         if not v:isWanted() then
  889.             draw.RoundedBox(0, 0, 0, w, h, Color(120, 0, 0, 255))
  890.             if self.on_cursor_entered then
  891.                 draw.RoundedBox(0, 0, 0, w, h, Color(100, 0, 0, 255))
  892.                 draw.SimpleText(">>  " .. lang_agc.WantedInfo .. "  <<", buttonFont, w / 2, h / 2, color_white, 1, 1)
  893.             else
  894.                 draw.SimpleText(lang_agc.WantedInfo, buttonFont, w / 2, h / 2, color_white, 1, 1)
  895.             end
  896.         else
  897.             draw.RoundedBox(0, 0, 0, w, h, Color(0, 80, 0, 255))
  898.             if self.on_cursor_entered then
  899.                 draw.RoundedBox(0, 0, 0, w, h, Color(0, 60, 0, 255))
  900.                 draw.SimpleText(">>  " .. lang_agc.Button_Unwanted .. "  <<", buttonFont, w / 2, h / 2, color_white, 1, 1)
  901.             else
  902.                 draw.SimpleText(lang_agc.Button_Unwanted, buttonFont, w / 2, h / 2, color_white, 1, 1)
  903.             end
  904.         end
  905.     end
  906.     WantedB.DoClick = function()
  907.         if not v:isWanted() then
  908.             net.Start("AGC_Wanted")
  909.         else
  910.             net.Start("AGC_Unwanted")
  911.         end
  912.         net.WriteString(v:Name())
  913.         net.WriteString("Запрос от базы данных")
  914.         net.SendToServer()
  915.         if IsValid(BaseC) then BaseC:Remove() end
  916.         caseFrame(v)
  917.     end
  918.  
  919.     local WarrantB = vgui.Create( "DButton", BaseC )
  920.     WarrantB:SetSize( 130, 25 )
  921.     WarrantB:SetPos( 325, 10 )
  922.     WarrantB:SetText("")
  923.     WarrantB.Paint = function( self, w, h)
  924.         draw.RoundedBox(0, 0, 0, w, h, Color(120, 0, 0, 255))
  925.         if self.on_cursor_entered then
  926.             draw.RoundedBox(0, 0, 0, w, h, Color(100, 0, 0, 255))
  927.             draw.SimpleText(">>  " .. lang_agc.Warrant .. "  <<", buttonFont, w / 2, h / 2, color_white, 1, 1)
  928.         else
  929.             draw.SimpleText(lang_agc.Warrant, buttonFont, w / 2, h / 2, color_white, 1, 1)
  930.         end
  931.     end
  932.     WarrantB.DoClick = function()
  933.         net.Start("AGC_Warrant")
  934.         net.WriteString(v:Name() or "Unknown")
  935.         net.WriteString("Запрос от базы данных")
  936.         net.SendToServer()
  937.         if IsValid(BaseC) then BaseC:Remove() end
  938.         caseFrame(v)
  939.     end
  940.  
  941.     local RefreshB = vgui.Create( "DButton", BaseC )
  942.     RefreshB:SetPos( 505, 10 )
  943.     RefreshB:SetText( "" )
  944.     RefreshB:SetSize( 26, 26 )
  945.     RefreshB.Paint = function( self, w, h )
  946.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  947.         surface.SetDrawColor(color_white)
  948.         surface.SetMaterial(mat_refresh)
  949.         surface.DrawTexturedRect( 5, 5, 16, 16)
  950.         if self.on_cursor_entered then
  951.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  952.         end
  953.     end
  954.     RefreshB.DoClick = function()
  955.         if IsValid(BaseC) then BaseC:Remove() end
  956.         caseFrame(v)
  957.     end
  958.  
  959.     local ExitB = vgui.Create( "DButton", BaseC )
  960.     ExitB:SetPos( 535, 10 )
  961.     ExitB:SetText( "" )
  962.     ExitB:SetSize( 26, 26 )
  963.     ExitB.Paint = function( self, w, h )
  964.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  965.         surface.SetDrawColor(color_white)
  966.         surface.SetMaterial(mat_cross)
  967.         surface.DrawTexturedRect( 5, 5, 16, 16)
  968.         if self.on_cursor_entered then
  969.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  970.         end
  971.     end
  972.     ExitB.DoClick = function()
  973.         if IsValid(BaseC) then BaseC:Remove() end
  974.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  975.     end
  976.  
  977.     for k,l in pairs(BaseC:GetChildren()) do
  978.         if l:GetName() == "DButton" then
  979.             l.OnCursorEntered = function(self)
  980.                 self.on_cursor_entered = true
  981.             end
  982.             l.OnCursorExited = function(self)
  983.                 self.on_cursor_entered = false
  984.             end
  985.         end
  986.     end
  987. end
  988.  
  989. local function DBPolice()
  990.     local lang_agc = AGC.Language[AGC.MainLanguage]
  991.     FCasier = vgui.Create( "DFrame" )
  992.     FCasier:SetSize( 455, 700 )
  993.     FCasier:SetTitle("")
  994.     FCasier:Center()
  995.     FCasier:SetDraggable( false )
  996.     FCasier:MakePopup()
  997.     FCasier:ShowCloseButton( false )
  998.     FCasier.Paint = function( self, w, h)
  999.         draw.RoundedBox(0, 0, 0, w, 40, Color(20, 20, 20, 200) )
  1000.         draw.SimpleText(lang_agc.SearchSomeone,"AGC_CaseFA",10,20,Color(255,255,255,255),0,1)
  1001.     end
  1002.  
  1003.     local CasierPanelList = vgui.Create( "DPanelList", FCasier )
  1004.     CasierPanelList:SetSize( 500, 450 )
  1005.     CasierPanelList:SetPos( 0, 50 )
  1006.     CasierPanelList:SetSpacing(10)
  1007.     CasierPanelList:EnableVerticalScrollbar( true )
  1008.     CasierPanelList.Paint = function() end
  1009.  
  1010.     local RefreshB = vgui.Create( "DButton", FCasier )
  1011.     RefreshB:SetPos( 387, 7 )
  1012.     RefreshB:SetText( "" )
  1013.     RefreshB:SetSize( 26, 26 )
  1014.     RefreshB.Paint = function( self, w, h )
  1015.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  1016.         surface.SetDrawColor(color_white)
  1017.         surface.SetMaterial(mat_tick)
  1018.         surface.DrawTexturedRect( 5, 5, 16, 16)
  1019.         if self.on_cursor_entered then
  1020.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  1021.         end
  1022.     end
  1023.     RefreshB.DoClick = function()
  1024.         if IsValid(PanelCheck) then PanelCheck:Remove() end
  1025.     end
  1026.  
  1027.     local ExitB = vgui.Create( "DButton", FCasier )
  1028.     ExitB:SetPos( 420, 7 )
  1029.     ExitB:SetText( "" )
  1030.     ExitB:SetSize( 26, 26 )
  1031.     ExitB.Paint = function( self, w, h )
  1032.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  1033.         surface.SetDrawColor(color_white)
  1034.         surface.SetMaterial(mat_cross)
  1035.         surface.DrawTexturedRect( 5, 5, 16, 16)
  1036.         if self.on_cursor_entered then
  1037.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  1038.         end
  1039.     end
  1040.     ExitB.DoClick = function()
  1041.         if IsValid(FCasier) then FCasier:Remove() end
  1042.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  1043.     end
  1044.  
  1045.     local SearchEntry = vgui.Create( "DTextEntry", FCasier )
  1046.     SearchEntry:SetPos( 175, 10 )
  1047.     SearchEntry:SetSize( 200, 20 )
  1048.     SearchEntry:SetText( "" )
  1049.     SearchEntry.OnChange = function(self)
  1050.         for _,v in pairs(player.GetAll()) do
  1051.             if self:GetValue() == "" or string.len(self:GetValue()) <= 2 and v.agc_search then
  1052.                 v.agc_search = false
  1053.                 if IsValid(PanelCheck) then PanelCheck:Remove() end
  1054.                 return
  1055.             end
  1056.             if (string.StartWith( string.lower(v:Name()), string.lower(self:GetValue())) or string.StartWith( string.reverse(string.lower(v:Name())), string.reverse(string.lower(self:GetValue())))) and not v.agc_search and string.len(self:GetValue()) >= 3 then
  1057.                 PanelCheck = vgui.Create( "DPanel", CasierPanelList )
  1058.                 PanelCheck:SetSize( 500, 105 )
  1059.                 PanelCheck:SetPos( 0, 0 )
  1060.                 PanelCheck.Paint = function() end
  1061.  
  1062.                 local PanelButton = vgui.Create("DButton", PanelCheck)
  1063.                 PanelButton:SetSize(500,105)
  1064.                 PanelButton:SetPos(0,0)
  1065.                 PanelButton:SetText("")
  1066.                 PanelButton:SetTooltip(lang_agc.SearchInfo)
  1067.                 PanelButton.Paint = function(menu, w, h)
  1068.                     if menu.on_cursor_entered then
  1069.                         draw.RoundedBox(0, 0, 0, w, h, Color(20, 20, 20, 235) )
  1070.                     else
  1071.                         draw.RoundedBox(0, 0, 0, w, h, Color(20, 20, 20, 200) )
  1072.                     end
  1073.                     draw.SimpleTextOutlined( v:Name(), "AGC_CaseFC", 10, 20, team.GetColor(), 0, 1, 0.75, color_black )
  1074.                     draw.SimpleText(v:Name() .. " occupies the job " .. v.DarkRPVars.job .. ".","AGC_CaseFB",10,47,Color(255,255,255,255),0,1)
  1075.                     draw.SimpleText(lang_agc.SearchPerm,"AGC_CaseFB",10,70,Color(255,255,255,255),0,1)
  1076.                     draw.SimpleText(lang_agc.SearchInfo,"AGC_CaseFB",10,85,Color(255,255,255,255),0,1)
  1077.                 end
  1078.                 PanelButton.DoClick = function()
  1079.                     if IsValid(FCasier) then FCasier:Remove() end
  1080.                     caseFrame(v)
  1081.                 end
  1082.                 PanelButton.OnCursorEntered = function(menu)
  1083.                     menu.on_cursor_entered = true
  1084.                 end
  1085.                 PanelButton.OnCursorExited = function(menu)
  1086.                     menu.on_cursor_entered = false
  1087.                 end
  1088.  
  1089.                 if not v.agc_search then
  1090.                     local npc_icon = vgui.Create( "DModelPanel", PanelCheck )
  1091.                     npc_icon:SetPos( 340, -10 )
  1092.                     npc_icon:SetSize( 125, 125 )
  1093.                     npc_icon:SetModel( v:GetModel() )
  1094.                     npc_icon:SetTooltip(v:GetName())
  1095.                     npc_icon:SetMouseInputEnabled(false)
  1096.                     npc_icon:SetKeyboardInputEnabled(false)
  1097.                     npc_icon.LayoutEntity = function() return end
  1098.                     npc_icon:SetFOV( 58 )
  1099.                     npc_icon:SetCamPos( Vector( 25, 0, 62 ) )
  1100.                     npc_icon:SetLookAt( Vector( 0, 0, 65 ) )
  1101.                     v.agc_search = true
  1102.                 end
  1103.                 CasierPanelList:AddItem( PanelCheck )
  1104.             end
  1105.         end
  1106.     end
  1107.  
  1108.     for k,v in pairs(FCasier:GetChildren()) do
  1109.         if v:GetName() == "DButton" then
  1110.             v.OnCursorEntered = function(self)
  1111.                 self.on_cursor_entered = true
  1112.             end
  1113.             v.OnCursorExited = function(self)
  1114.                 self.on_cursor_entered = false
  1115.             end
  1116.         end
  1117.     end
  1118. end
  1119.  
  1120. local function ComplaintFrame()
  1121.     local lang_agc = AGC.Language[AGC.MainLanguage]
  1122.     local isHacked = isNearAHackedComputer(LocalPlayer())
  1123.     local BaseC = vgui.Create( "DFrame" )
  1124.     BaseC:SetSize( 700, 475 )
  1125.     BaseC:SetTitle("")
  1126.     BaseC:Center()
  1127.     BaseC:SetDraggable( false )
  1128.     BaseC:MakePopup()
  1129.     BaseC:ShowCloseButton( false )
  1130.     BaseC.Paint = function( self, w, h)
  1131.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 240))
  1132.         draw.SimpleText(lang_agc.Complaint_Title, "AGC_Ta_17", 15, 15, color_white, 0, 1)
  1133.         draw.SimpleText(lang_agc.Complaint_Desc, "AGC_Ta_16", 15, 32.5, color_white, 0, 1)
  1134.     end
  1135.  
  1136.     local CaseList = vgui.Create( "DListView", BaseC )
  1137.     CaseList:SetPos( 10, 60)
  1138.     CaseList:SetSize( 680, 405)
  1139.     CaseList:SetMultiSelect( false )
  1140.     CaseList:AddColumn(lang_agc.Case_Identity):SetFixedWidth( 125 )
  1141.     CaseList:AddColumn(lang_agc.Case_Date):SetFixedWidth( 100 )
  1142.     CaseList:AddColumn(lang_agc.Case_Reporter):SetFixedWidth( 125 )
  1143.     CaseList:AddColumn(lang_agc.Case_Entry)
  1144.     net.Start( "CaseInit" )
  1145.     net.SendToServer()
  1146.  
  1147.     local data = {}
  1148.     net.Receive( "CaseReload", function()
  1149.         data = net.ReadTable()
  1150.         if data then
  1151.             for k,v in pairs(data) do
  1152.                 CaseList:AddLine(v.target, os.date("%d/%m - %H:%M", v.date), v.reporter, v.reason, k)
  1153.             end
  1154.         end
  1155.     end)
  1156.  
  1157.     CaseList.OnRowRightClick = function ( self, row )
  1158.         local selectact = DermaMenu()
  1159.         selectact:AddOption( lang_agc.WantedInfo, function() CmdMenu( lang_agc.Wanted, lang_agc.Cmd_Desc, "AGC_Wanted", "1", "2" ) end )
  1160.         :SetIcon("icon16/exclamation.png")
  1161.  
  1162.         selectact:AddOption( lang_agc.Case_Delete, function()
  1163.             if IsValid(ErrorB) then ErrorB:Remove() end
  1164.             if AGC.DeleteComplaint and not table.HasValue( AGC.DeleteComplaint, team.GetName(LocalPlayer():Team()) ) and not isHacked then
  1165.                 ErrorFrame( lang_agc.Case_CDelComp, 390, ScrW() / 2 - 200, ScrH() / 2 - 275 )
  1166.                 return
  1167.             end
  1168.  
  1169.             local id = tonumber(CaseList:GetLine(row):GetValue(5))
  1170.             if id and data[id] then
  1171.                 net.Start( "DeleteCase" )
  1172.                 net.WriteTable(data[id])
  1173.                 net.SendToServer()
  1174.                 self:RemoveLine(row)
  1175.                 ErrorFrame( lang_agc.Case_DelMsg, 350, ScrW() / 2 - 200, ScrH() / 2 - 275 )
  1176.             end
  1177.         end)
  1178.         :SetIcon("icon16/database_delete.png")
  1179.         selectact:Open()
  1180.     end
  1181.  
  1182.     local RefreshB = vgui.Create( "DButton", BaseC )
  1183.     RefreshB:SetPos( 630, 10 )
  1184.     RefreshB:SetText( "" )
  1185.     RefreshB:SetSize( 26, 26 )
  1186.     RefreshB.Paint = function( self, w, h )
  1187.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  1188.         surface.SetDrawColor(color_white)
  1189.         surface.SetMaterial(mat_refresh)
  1190.         surface.DrawTexturedRect( 5, 5, 16, 16)
  1191.         if self.on_cursor_entered then
  1192.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  1193.         end
  1194.     end
  1195.     RefreshB.DoClick = function()
  1196.         CaseList:Clear()
  1197.         net.Start( "CaseInit" )
  1198.         net.SendToServer()
  1199.         net.Receive( "CaseReload", function()
  1200.         data = net.ReadTable()
  1201.             if data then
  1202.                 for k,v in pairs(data) do
  1203.                     CaseList:AddLine(v.target, os.date("%d/%m - %H:%M", v.date), v.reporter, v.reason, k)
  1204.                 end
  1205.             end
  1206.         end)
  1207.     end
  1208.  
  1209.     local ExitB = vgui.Create( "DButton", BaseC )
  1210.     ExitB:SetPos( 663, 10 )
  1211.     ExitB:SetText( "" )
  1212.     ExitB:SetSize( 26, 26 )
  1213.     ExitB.Paint = function( self, w, h )
  1214.         draw.RoundedBox(6, 0, 0, w, h, color_white)
  1215.         surface.SetDrawColor(color_white)
  1216.         surface.SetMaterial(mat_cross)
  1217.         surface.DrawTexturedRect( 5, 5, 16, 16)
  1218.         if self.on_cursor_entered then
  1219.             draw.RoundedBox(6, 0, 0, w, h, Color(50, 150, 255, 75))
  1220.         end
  1221.     end
  1222.     ExitB.DoClick = function()
  1223.         if IsValid(BaseC) then BaseC:Remove() end
  1224.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( true ) end
  1225.     end
  1226. end
  1227.  
  1228. function BaseComputer(ent)
  1229.     if ent and (ent:GetClass() == "apc_computer" and ent:GetWallpaper() == "") then ent:SetWallpaper("georgeebizzle_welcome_to_city17_its_safer_here.jpg") end
  1230.     if IsValid(BaseDesktop) then BaseDesktop:Remove() end
  1231.     local isHacked = isNearAHackedComputer(LocalPlayer())
  1232.     BaseDesktop = vgui.Create( "DFrame" )
  1233.     local buttonFont, littlescreen
  1234.     if ScrW() <= 1440 or ScrH() <= 800 then
  1235.         BaseDesktop:SetSize( ScrW() / 1.375, ScrH() / 1.35 )
  1236.         buttonFont = "AGC_Ge_10"
  1237.         littlescreen = true
  1238.     else
  1239.         BaseDesktop:SetSize( 1440, 800 )
  1240.         buttonFont = "AGC_Ge_15"
  1241.         littlescreen = false
  1242.     end
  1243.     BaseDesktop:SetTitle("")
  1244.     BaseDesktop:Center()
  1245.     BaseDesktop:SetDraggable( false )
  1246.     BaseDesktop:MakePopup()
  1247.     BaseDesktop:ShowCloseButton( false )
  1248.     BaseDesktop.mat_wallpaper = Material("backgrounds/" .. (ent:GetClass() == "apc_computer" and ent:GetWallpaper() or "georgeebizzle_welcome_to_city17_its_safer_here.jpg"))
  1249.     local x, y = BaseDesktop:GetWide(), BaseDesktop:GetTall()
  1250.  
  1251.     BaseDesktop.Paint = function( self, w, h)
  1252.         draw.RoundedBox(4, 0, 0, w, h, Color(80, 80, 80, 255))
  1253.         surface.SetDrawColor(color_white)
  1254.         surface.SetMaterial(self.mat_wallpaper)
  1255.         surface.DrawTexturedRect( 10, 10, w - 20, h - 20)
  1256.         draw.RoundedBox(4, 10, y - 55, w - 20, 45, Color(0, 0, 0, 200))
  1257.         draw.SimpleText( os.date( "%H:%M" , Timestamp ), "AGC_Ta_17", w - 60, h - 42.5, color_white, 1, 1 )
  1258.         draw.SimpleText( os.date( "%d/%m/%Y" , Timestamp ), "AGC_Ta_17", w - 60, h - 25, color_white, 1, 1 )
  1259.         draw.SimpleText( string.upper(GetConVar("gmod_language"):GetString()), "AGC_Ta_17", w - 120, h - 32.5, color_white, 1, 1 )
  1260.         draw.SimpleText( isHacked and "John Smith" or LocalPlayer():Name(), "AGC_Ta_17", 60, h - 40, color_white, 0, 1 )
  1261.         draw.SimpleText( isHacked and "Unknown" or LocalPlayer().DarkRPVars.job, "AGC_Ta_17", 60, h - 25, color_white, 0, 1 )
  1262.         if isHacked then
  1263.             surface.SetDrawColor( Color(255,0,0,255) )
  1264.             surface.SetMaterial(mat_ano)
  1265.             surface.DrawTexturedRect( w - 512, 50, 512, 256)
  1266.         end
  1267.     end
  1268.  
  1269.     local plyIcon = vgui.Create( "SpawnIcon" , BaseDesktop )
  1270.     plyIcon:SetSize( 45, 45 )
  1271.     plyIcon:SetPos( 10, y - 55 )
  1272.     plyIcon:SetModel( isHacked and "models/error.mdl" or LocalPlayer():GetModel() )
  1273.     plyIcon:SetTooltip( isHacked and "ERROR SYSTEM" or LocalPlayer():Name() )
  1274.  
  1275.     local lang_agc = AGC.Language[AGC.MainLanguage]
  1276.     local xbu = 0.13
  1277.     local bsize = ScrW() * 0.078125
  1278.     local ButtonExit = vgui.Create( "DButton", BaseDesktop )
  1279.     ButtonExit:SetSize( bsize, 25 )
  1280.     ButtonExit:SetPos( x * xbu, y - 45 )
  1281.     ButtonExit:SetText("")
  1282.     ButtonExit.Paint = function( self, w, h)
  1283.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(180, 0, 0, 255) or Color(180, 0, 0, 200))
  1284.         draw.SimpleText(self.on_cursor_entered and ">>  ".. lang_agc.Button_Disconnect .."  <<" or lang_agc.Button_Disconnect, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1285.     end
  1286.     ButtonExit.DoClick = function()
  1287.         if IsValid(BaseDesktop) then BaseDesktop:Remove() end
  1288.     end
  1289.  
  1290.     local WantedB = vgui.Create( "DButton", BaseDesktop )
  1291.     WantedB:SetSize( bsize, 25 )
  1292.     WantedB:SetPos( x * xbu * 2, y - 45 )
  1293.     WantedB:SetText("")
  1294.     WantedB.Paint = function( self, w, h)
  1295.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(120, 0, 0, 255) or Color(120, 0, 0, 200))
  1296.         draw.SimpleText(self.on_cursor_entered and ">>  " .. lang_agc.Wanted .. "  <<" or lang_agc.Wanted, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1297.     end
  1298.     WantedB.DoClick = function()
  1299.         CmdMenu( lang_agc.Wanted, lang_agc.Cmd_Desc, "AGC_Wanted", "1", "2" )
  1300.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1301.     end
  1302.  
  1303.     local WarrantB = vgui.Create( "DButton", BaseDesktop )
  1304.     WarrantB:SetSize( bsize, 25 )
  1305.     WarrantB:SetPos( x * xbu * 3, y - 45 )
  1306.     WarrantB:SetText("")
  1307.     WarrantB.Paint = function( self, w, h)
  1308.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(120, 0, 0, 255) or Color(120, 0, 0, 200))
  1309.         draw.SimpleText(self.on_cursor_entered and ">>  " .. lang_agc.Button_Warrant .. "  <<" or lang_agc.Button_Warrant, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1310.     end
  1311.     WarrantB.DoClick = function()
  1312.         CmdMenu( lang_agc.Button_Warrant, lang_agc.Cmd_Desc, "AGC_Warrant", "1" )
  1313.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1314.     end
  1315.  
  1316.     local UnWarrantB = vgui.Create( "DButton", BaseDesktop )
  1317.     UnWarrantB:SetSize( bsize, 25 )
  1318.     UnWarrantB:SetPos( x * xbu * 4, y - 45 )
  1319.     UnWarrantB:SetText("")
  1320.     UnWarrantB.Paint = function( self, w, h)
  1321.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(0, 80, 0, 255) or Color(0, 80, 0, 200))
  1322.         draw.SimpleText(self.on_cursor_entered and ">>  " .. lang_agc.Button_Unwarrant .. "  <<" or lang_agc.Button_Unwarrant, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1323.     end
  1324.     UnWarrantB.DoClick = function()
  1325.         CmdMenu( lang_agc.Button_Unwarrant, lang_agc.Cmd_Desc, "AGC_Unwarrant", "2" )
  1326.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1327.     end
  1328.  
  1329.     local UnWantedB = vgui.Create( "DButton", BaseDesktop )
  1330.     UnWantedB:SetSize( bsize, 25 )
  1331.     UnWantedB:SetPos( x * xbu * 5, y - 45 )
  1332.     UnWantedB:SetText("")
  1333.     UnWantedB.Paint = function( self, w, h)
  1334.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(0, 80, 0, 255) or Color(0, 80, 0, 200))
  1335.         draw.SimpleText(self.on_cursor_entered and ">>  " .. lang_agc.Button_Unwanted .. "  <<" or lang_agc.Button_Unwanted, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1336.     end
  1337.     UnWantedB.DoClick = function()
  1338.         CmdMenu( lang_agc.Button_Unwanted, lang_agc.Cmd_Desc, "AGC_Unwanted", "2", "1" )
  1339.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1340.     end
  1341.  
  1342.     local AgendaB = vgui.Create( "DButton", BaseDesktop )
  1343.     AgendaB:SetSize( bsize, 25 )
  1344.     AgendaB:SetPos( x * xbu * 6, y - 45 )
  1345.     AgendaB:SetText("")
  1346.     AgendaB.Paint = function( self, w, h)
  1347.         draw.RoundedBox(4, 0, 0, w, h, self.on_cursor_entered and Color(0, 80, 120, 255) or Color(0, 80, 150, 200))
  1348.         draw.SimpleText(self.on_cursor_entered and ">>  " .. lang_agc.Button_Agenda .. "  <<" or lang_agc.Button_Agenda, buttonFont, w / 2, h / 2, color_white, 1, 1)
  1349.     end
  1350.     AgendaB.DoClick = function()
  1351.         if IsValid(ErrorB) then ErrorB:Remove() end
  1352.         if not LocalPlayer():isMayor() then
  1353.             ErrorFrame( lang_agc.Agenda_Error, 250, ScrW() * 0.68, ScrH() * 0.782  )
  1354.             return
  1355.         end
  1356.         CmdMenu( lang_agc.Button_Agenda, lang_agc.Cmd_Agenda_Desc, "/agenda", "3" )
  1357.         if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1358.     end
  1359.  
  1360.     for k,v in pairs( Icon_Base ) do
  1361.         local Bib = vgui.Create( "DPanel", BaseDesktop )
  1362.         Bib:SetSize( x * 0.0694, y * 0.1125)
  1363.         Bib:SetPos( x * 0.013, y * 0.125 * k - 60 )
  1364.         Bib.Paint = function(self, w, h)
  1365.             surface.SetDrawColor(color_white)
  1366.             surface.SetMaterial(Material( v.Icon ))
  1367.             surface.DrawTexturedRect( 16, 4, y * 0.08, y * 0.08)
  1368.             if littlescreen then
  1369.                 draw.SimpleText(v.Title, "AGC_Ta_13", w / 2 + 5, h * 0.85, color_white, 1, 1)
  1370.             else
  1371.                 draw.SimpleText(v.Title, "AGC_Ta_13", w / 2 - 1.5, h * 0.85, color_white, 1, 1)
  1372.             end
  1373.         end
  1374.         local IconB = vgui.Create( "DButton", Bib )
  1375.         IconB:SetPos( 16, 0 )
  1376.         IconB:SetText( "" )
  1377.         IconB:SetSize( x * 0.0444, y * 0.1125 )
  1378.         IconB.Paint = function( self, w, h)
  1379.             if self.on_cursor_entered then
  1380.                 draw.RoundedBox(6, 0, 0, w, h, Color(255, 255, 255, 7))
  1381.             end
  1382.         end
  1383.         IconB.DoClick = function()
  1384.             if v.Action == "1" then
  1385.                 AGCLogsFrame()
  1386.             elseif v.Action == "2" then
  1387.                 ComplaintFrame()
  1388.             elseif v.Action == "3" then
  1389.                 ArrWanFrame(true)
  1390.             elseif v.Action == "4" then
  1391.                 ArrWanFrame(false)
  1392.             elseif v.Action == "5" then
  1393.                 DBPolice()
  1394.             elseif v.Action == "6" then
  1395.                 SettingsFrame(ent)
  1396.             elseif v.Action == "7" then
  1397.                 _ghomes_lister()
  1398.             end
  1399.             if IsValid(BaseDesktop) then BaseDesktop:SetMouseInputEnabled( false ) end
  1400.         end
  1401.         IconB.OnCursorEntered = function( self )
  1402.             self.on_cursor_entered = true
  1403.         end
  1404.         IconB.OnCursorExited = function( self )
  1405.             self.on_cursor_entered = false
  1406.         end
  1407.     end
  1408.  
  1409.     for k,v in pairs(BaseDesktop:GetChildren()) do
  1410.         if v:GetName() == "DButton" then
  1411.             v.OnCursorEntered = function(self)
  1412.                 self.on_cursor_entered = true
  1413.             end
  1414.             v.OnCursorExited = function(self)
  1415.                 self.on_cursor_entered = false
  1416.             end
  1417.         end
  1418.     end
  1419. end
  1420.  
  1421. net.Receive("CaseMenu", function()
  1422.     local lang_agc = AGC.Language[AGC.MainLanguage]
  1423.     local BaseNCase = vgui.Create( "DFrame" )
  1424.     BaseNCase:SetSize( 540 , 215)
  1425.     BaseNCase:SetTitle("")
  1426.     BaseNCase:Center()
  1427.     BaseNCase:SetDraggable( false )
  1428.     BaseNCase:MakePopup()
  1429.     BaseNCase:ShowCloseButton( false )
  1430.     BaseNCase.Paint = function( self, w, h)
  1431.         draw.RoundedBox(4, 0, 0, w, h, color_black )
  1432.         draw.RoundedBox(4, 1, 1, w - 2, h - 2, Color(50, 50, 50, 255) )
  1433.  
  1434.         draw.RoundedBox(4, 9, 9, w - 18, h - 18, color_black)
  1435.         draw.RoundedBox(4, 10, 10, w - 20, h - 20, Color(20, 20, 20, 255))
  1436.  
  1437.         draw.SimpleText( lang_agc.Case_Frame, "AGC_Bu_20", 200, 30, color_white, 1, 1)
  1438.         draw.SimpleText( lang_agc.Case_Frame_Desc, "AGC_Bu_17", 200, 50, color_white, 1, 1)
  1439.         --draw.SimpleText("C:/Police/>", "BudgetLabel", 20, 20, Color(255, 255, 255, 10))
  1440.         if tooletter then
  1441.             draw.SimpleText(lang_agc.Case_ErrorLon, "AGC_Bu_17", 200, 145, Color(180, 0, 0), 1, 1)
  1442.         end
  1443.     end
  1444.  
  1445.     local ExitB = vgui.Create( "DButton", BaseNCase )
  1446.     ExitB:SetSize( 100, 35 )
  1447.     ExitB:SetPos( 250, 160 )
  1448.     ExitB:SetText("")
  1449.     ExitB.Paint = function( self, w, h)
  1450.         draw.RoundedBox(2, 0, 0, w, h, Color(180, 0, 0, 225))
  1451.         draw.SimpleText(lang_agc.Case_Abort, "BudgetLabel", w / 2, h / 2, color_white, 1, 1)
  1452.     end
  1453.     ExitB.DoClick = function()
  1454.         if IsValid(BaseNCase) then BaseNCase:Remove() end
  1455.     end
  1456.     tooletter = false
  1457.     local EntryArg = vgui.Create( "DTextEntry", BaseNCase )
  1458.     EntryArg:SetPos( 50, 75 )
  1459.     EntryArg:SetText( "" )
  1460.     EntryArg:SetSize( 300, 30 )
  1461.     EntryArg.Paint = function( self, w, h)
  1462.         draw.RoundedBox(4, 0, 0, w, h, color_white)
  1463.         draw.SimpleText(self:GetValue(), "AGC_Bu_17", w / 2, h / 2, color_black, 1, 1)
  1464.         self:DrawTextEntryText(color_black, self.m_colHighlight, color_black)
  1465.     end
  1466.  
  1467.     local select_plyc = vgui.Create( "DComboBox", BaseNCase )
  1468.     select_plyc:SetPos(132.5, 115)
  1469.     select_plyc:SetSize(125, 20)
  1470.     for _,v in pairs( player.GetAll() ) do
  1471.         select_plyc:AddChoice(v:Name())
  1472.     end
  1473.  
  1474.     local SendB = vgui.Create( "DButton", BaseNCase )
  1475.     SendB:SetSize( 100, 35 )
  1476.     SendB:SetPos( 50, 160 )
  1477.     SendB:SetText("")
  1478.     SendB.Paint = function( self, w, h)
  1479.         draw.RoundedBox(2, 0, 0, w, h, Color(0, 80, 0, 225))
  1480.         draw.SimpleText(lang_agc.Button_Send, "BudgetLabel", w / 2, h / 2, color_white, 1, 1)
  1481.     end
  1482.  
  1483.     SendB.DoClick = function()
  1484.         local target = select_plyc:GetSelected()
  1485.         local reason = EntryArg:GetValue()
  1486.         if reason and string.len( reason ) <= 44 and target and string.len(target) <= 30 and IsValid(LocalPlayer()) then
  1487.             if IsValid(BaseNCase) then BaseNCase:Remove() end
  1488.             net.Start("agc:createCase")
  1489.             net.WriteTable({target, reason})
  1490.             net.SendToServer()
  1491.         else
  1492.             tooletter = true
  1493.         end
  1494.     end
  1495.  
  1496.     local npc_icon = vgui.Create( "DModelPanel", BaseNCase )
  1497.     npc_icon:SetPos( 380 , 5 )
  1498.     npc_icon:SetSize( 150 , 200 )
  1499.     npc_icon:SetModel( AGC.NPC_Model )
  1500.     npc_icon.LayoutEntity = function() return false end
  1501.     npc_icon:SetFOV( 40 )
  1502.     npc_icon:SetCamPos( Vector( 25, 5, 62 ) )
  1503.     npc_icon:SetLookAt( Vector( 0, 0, 62 ) )
  1504.     npc_icon.Entity:SetEyeTarget( Vector( 150, 0, 50 ) )
  1505. end)
  1506.  
  1507. hook.Add("InitPostEntity", "LoadPoliceFonts", function()
  1508.     surface.CreateFont( "AGC_Ge_75", { font = "Georgia", size = 75, weight = 400, } )
  1509.     surface.CreateFont( "AGC_Ge_15", { font = "Georgia", size = 15, weight = 400, } )
  1510.     surface.CreateFont( "AGC_Ge_10", { font = "Georgia", size = 12, weight = 400, } )
  1511.     surface.CreateFont( "AGC_Ge_20", { font = "Georgia", size = 20, weight = 400, } )
  1512.     surface.CreateFont( "AGC_Ge_30", { font = "Georgia", size = 30, weight = 400, } )
  1513.  
  1514.     surface.CreateFont( "AGC_Bu_20", { font = "BudgetLabel", size = 20, weight = 400, } )
  1515.     surface.CreateFont( "AGC_Bu_17", { font = "BudgetLabel", size = 17, weight = 400, } )
  1516.     surface.CreateFont( "AGC_Ta_17", { font = "Tahoma", size = 17.5, weight = 500, } )
  1517.     surface.CreateFont( "AGC_Ta_16", { font = "Tahoma", size = 16, weight = 500, } )
  1518.     surface.CreateFont( "AGC_Ta_13", { font = "Tahoma", size = 13, weight = 500, } )
  1519.     surface.CreateFont( "AGC_La_22", { font = "Lato", size = 22.5, weight = 500, } )
  1520.     surface.CreateFont( "AGC_Hack_25", { font = "Lato", size = 25, weight = 500, } )
  1521. end)
  1522.  
  1523. hook.Add( "PopulateToolMenu", "Bind Vehicle Button", function()
  1524.     spawnmenu.AddToolMenuOption( "Utilities", "AGC", "Bind AGC", "Bind Key AGC", "", "", function (menu)
  1525.         menu:AddControl( "Label", { Text = "When you press this bind you access the police computer. (You need to be in police vehicle)" } )
  1526.         menu:AddControl( "Numpad", { Label = "Open AGC", Command = "agc_key_vehicle" } )
  1527.     end)
  1528. end)
  1529.  
  1530. hook.Add( "PlayerBindPress", "Open Menu Vehicle", function()
  1531.     if input.IsKeyDown(GetConVar("agc_key_vehicle"):GetInt()) then
  1532.         local ply = LocalPlayer()
  1533.         if IsValid( ply ) and ply:InVehicle() then
  1534.             local plyvehicle = ply:GetVehicle()
  1535.             if IsValid(plyvehicle) and ((plyvehicle:GetClass() == "prop_vehicle_jeep" and table.HasValue( AGC.VehicleAccess, plyvehicle:GetModel())) or (IsValid(plyvehicle:GetParent()) and plyvehicle:GetParent():IsVehicle())) then
  1536.                 AuthFrame(plyvehicle) -- {{ user_id }
  1537.                 return
  1538.             end
  1539.         end
  1540.     end
  1541. end)
  1542.  
  1543. concommand.Add("agc_exit", function()
  1544.     if IsValid(BaseDesktop) then BaseDesktop:Remove() end
  1545. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement