Skip to content

Instantly share code, notes, and snippets.

@AMD-NICK
Created October 4, 2015 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMD-NICK/bb67a2a99adf4adc2fe5 to your computer and use it in GitHub Desktop.
Save AMD-NICK/bb67a2a99adf4adc2fe5 to your computer and use it in GitHub Desktop.
[FREE] Gmod-Best New F4 Skin
local VoteVGUI = {}
local QuestionVGUI = {}
local PanelNum = 0
local LetterWritePanel
local t = "/vote"
local vt = "Голосование"
surface.CreateFont( "fontclose", { font = "Arial", size = 14, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "logfond", { font = "Impact", size = 45, weight = 400, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "buyitemfont", { font = "Arial", size = 16, weight = 700, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "sidefont", { font = "Arial", size = 22, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "sidefont2", { font = "Arial", size = 22, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "plyname", { font = "Arial", size = 22, weight = 550, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "boxtitlef", { font = "Arial", size = 24, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "boxmainf", { font = "Arial", size = 16, weight = 700, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "buttontextfont", { font = "Arial", size = 18, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "jobtitlef", { font = "Arial", size = 22, weight = 700, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "jobmainf", { font = "Arial", size = 13, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "entmainf", { font = "Arial", size = 16, weight = 700, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "CategoryTitle", { font = "Arial", size = 16, weight = 500, blursize = 0, scanlines = 0, antialias = true} )
surface.CreateFont( "VoteFont", { font = "Arial", size = 18, weight = 700, blursize = 0, scanlines = 0, antialias = true} )
local function MsgDoVote(msg)
local question = string.Implode( " ", string.Explode( " ", msg:ReadString()))
local voteid = msg:ReadShort()
local timeleft = msg:ReadFloat()
if timeleft == 0 then timeleft = 100 end
local OldTime = CurTime()
if not IsValid(LocalPlayer()) then return end -- Sent right before player initialisation
LocalPlayer():EmitSound("Town.d1_town_02_elevbell1", 100, 100)
local panel = vgui.Create("DFrame")
panel:SetPos(10,10 + PanelNum)
panel:SetSize( ScrW()-20 , 35 )
panel:SetTitle("")
panel:SetSizable(false)
panel:SetDraggable( false )
panel:ShowCloseButton( false )
panel.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 90 ) )
local time = tostring(math.Clamp(math.ceil(timeleft - (CurTime() - OldTime)), 0, 9999))
draw.SimpleText( time, "VoteFont", w - 6, 5, Color( 255, 255, 255, 255 ), TEXT_ALIGN_RIGHT )
draw.SimpleText( "Голосование: " .. question, "VoteFont", 20, 10, Color( 255, 255, 255, 255 ), TEXT_ALIGN_LEFT )
end
function panel:Close()
PanelNum = PanelNum - 40
VoteVGUI[voteid .. "vote"] = nil
local num = panel:GetTall()
for k,v in SortedPairs(VoteVGUI) do v:SetPos(10, num) num = num + 40 end
for k,v in SortedPairs(QuestionVGUI) do v:SetPos(10, num) num = num + 40 end
self:Remove()
end
function panel:Think() if timeleft - (CurTime() - OldTime) <= 0 then panel:Close() end end
panel:SetKeyboardInputEnabled(false)
panel:SetMouseInputEnabled(true)
panel:SetVisible(true)
local ybutton = vgui.Create("Button")
ybutton:SetParent(panel)
ybutton:SetPos(panel:GetWide() - 205, 5)
ybutton:SetSize(80, panel:GetTall() - 10)
ybutton:SetCommand("!")
ybutton:SetText("Да")
ybutton:SetTextColor( Color(255,255,255) )
ybutton:SetVisible(true)
ybutton.Paint = function( self, w, h )
local gcol if self.hover then gcol = Color( 36, 190, 0 ) else gcol = Color( 36, 165, 0 ) end
draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 77, 0 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, gcol )
end
ybutton.DoClick = function()
LocalPlayer():ConCommand("vote " .. voteid .. " yea\n")
panel:Close()
end
local nbutton = vgui.Create("Button")
nbutton:SetParent(panel)
nbutton:SetPos(panel:GetWide() - 120, 5)
nbutton:SetSize(80, panel:GetTall() - 10)
nbutton:SetCommand("!")
nbutton:SetText("Нет")
nbutton:SetTextColor( Color(255,255,255) )
nbutton:SetVisible(true)
nbutton.Paint = function( self, w, h )
local gcol if self.hover then gcol = Color( 190, 10, 0 ) else gcol = Color( 165, 10, 0 ) end
draw.RoundedBox( 0, 0, 0, w, h, Color( 77, 0, 0 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, gcol )
end
nbutton.DoClick = function()
LocalPlayer():ConCommand("vote " .. voteid .. " nay\n")
panel:Close()
end
PanelNum = PanelNum + 40
VoteVGUI[voteid .. "vote"] = panel
end
usermessage.Hook("DoVote", MsgDoVote)
local function KillVoteVGUI(msg)
local id = msg:ReadShort()
if VoteVGUI[id .. "vote"] and VoteVGUI[id .. "vote"]:IsValid() then VoteVGUI[id.."vote"]:Close() end
end
usermessage.Hook("KillVoteVGUI", KillVoteVGUI)
local function MsgDoQuestion(msg)
local question = msg:ReadString()
local quesid = msg:ReadString()
local timeleft = msg:ReadFloat()
if timeleft == 0 then timeleft = 100 end
local OldTime = CurTime()
LocalPlayer():EmitSound("Town.d1_town_02_elevbell1", 100, 100)
local panel = vgui.Create("DFrame")
panel:SetPos(3 + PanelNum, ScrH() / 2 - 50)
panel:SetSize(300, 140)
panel:SetSizable(false)
panel.btnClose:SetVisible(false)
panel:SetKeyboardInputEnabled(false)
panel:SetMouseInputEnabled(true)
panel:SetVisible(true)
function panel:Close()
PanelNum = PanelNum - 300
QuestionVGUI[quesid .. "ques"] = nil
local num = 0
for k,v in SortedPairs(VoteVGUI) do v:SetPos(ScrW()-20, ScrH() / 2 - 50) num = num + 140 end
for k,v in SortedPairs(QuestionVGUI) do v:SetPos(ScrW()-20, num) num = num + 300 end
self:Remove()
end
function panel:Think()
self:SetTitle("Время: ".. tostring(math.Clamp(math.ceil(timeleft - (CurTime() - OldTime)), 0, 9999)))
if timeleft - (CurTime() - OldTime) <= 0 then panel:Close() end
end
local label = vgui.Create("DLabel")
label:SetParent(panel)
label:SetPos(5, 30)
label:SetSize(380, 40)
label:SetText(question)
label:SetVisible(true)
local divider = vgui.Create("Divider")
divider:SetParent(panel)
divider:SetPos(2, 80)
divider:SetSize(380, 2)
divider:SetVisible(true)
local ybutton = vgui.Create("DButton")
ybutton:SetParent(panel)
ybutton:SetPos(105, 100)
ybutton:SetSize(40, 20)
ybutton:SetText("Да")
ybutton:SetVisible(true)
ybutton.DoClick = function()
LocalPlayer():ConCommand("ans " .. quesid .. " 1\n") panel:Close()
end
local nbutton = vgui.Create("DButton")
nbutton:SetParent(panel)
nbutton:SetPos(155, 100)
nbutton:SetSize(40, 20)
nbutton:SetText("Нет")
nbutton:SetVisible(true)
nbutton.DoClick = function()
LocalPlayer():ConCommand("ans " .. quesid .. " 2\n") panel:Close()
end
PanelNum = PanelNum + 300
QuestionVGUI[quesid .. "ques"] = panel
panel:SetSkin(GAMEMODE.Config.DarkRPSkin)
end
usermessage.Hook("DoQuestion", MsgDoQuestion)
local function KillQuestionVGUI(msg)
local id = msg:ReadString()
if QuestionVGUI[id .. "ques"] and QuestionVGUI[id .. "ques"]:IsValid() then QuestionVGUI[id .. "ques"]:Close() end
end
usermessage.Hook("KillQuestionVGUI", KillQuestionVGUI)
local function DoVoteAnswerQuestion(ply, cmd, args)
if not args[1] then return end
local vote = 0
if tonumber(args[1]) == 1 or string.lower(args[1]) == "yes" or string.lower(args[1]) == "true" then vote = 1 end
for k,v in pairs(VoteVGUI) do if ValidPanel(v) then
local ID = string.sub(k, 1, -5)
VoteVGUI[k]:Close() RunConsoleCommand("vote", ID, vote) return end
end
for k,v in pairs(QuestionVGUI) do if ValidPanel(v) then
local ID = string.sub(k, 1, -5)
QuestionVGUI[k]:Close() RunConsoleCommand("ans", ID, vote) return end
end
end
concommand.Add("rp_vote", DoVoteAnswerQuestion)
local function DoLetter(msg)
LetterWritePanel = vgui.Create("Frame")
LetterWritePanel:SetPos(ScrW() / 2 - 75, ScrH() / 2 - 100)
LetterWritePanel:SetSize(150, 200)
LetterWritePanel:SetMouseInputEnabled(true)
LetterWritePanel:SetKeyboardInputEnabled(true)
LetterWritePanel:SetVisible(true)
end
usermessage.Hook("DoLetter", DoLetter)
local F4Menu
local F4MenuTabs
local F4Tabs = {}
local hasReleasedF4 = false
function GM:addF4MenuTab(name, tabControl, icon) return table.insert(F4Tabs, {name = name, ctrl = tabControl, icon = icon}) end
function GM:switchTabOrder(from, to) F4Tabs[from], F4Tabs[to] = F4Tabs[to], F4Tabs[from] end
function GM:removeTab(tabNr) if ValidPanel(F4Tabs[tabNr].ctrl) then F4Tabs[tabNr].ctrl:Remove() end table.remove(F4Tabs, tabNr) end
function OpenTextBox( text1, text2, cmd )
local bg = vgui.Create( "DFrame" )
bg:SetSize( 500, 150 )
bg:Center()
bg:MakePopup()
bg:SetTitle( "" )
bg:ShowCloseButton( false )
bg.Init = function(self)
self.startTime = SysTime()
end
bg.Paint = function( self, w, h )
Derma_DrawBackgroundBlur( self, self.startTime )
draw.RoundedBox( 0, 0, 0, w, h, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
draw.RoundedBox( 0, 0, 0, w, 50, Color( 23, 25, 37 ) )
draw.SimpleText( text1, "boxtitlef", 20, 15, Color( 255, 255, 255, 255 ) )
draw.SimpleText( text2, "boxmainf", w / 2, 65, Color( 0, 0, 0, 255 ), TEXT_ALIGN_CENTER )
end
textOpen = true
local cl = vgui.Create( "DButton", bg )
cl:SetSize( 50, 20 )
cl:SetPos( bg:GetWide() - 60, 0 )
cl:SetText( "X" )
cl:SetFont( "fontclose" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
local kcol
if self.hover then
kcol = Color( 255, 0, 0, 255 )
else
kcol = Color( 90, 0, 0 )
end
draw.RoundedBoxEx( 0, 0, 0, w , h , kcol, false, false, true, true )
end
cl.DoClick = function()
bg:Close()
textOpen = false
end
cl.OnCursorEntered = function( self )
self.hover = true
end
cl.OnCursorExited = function( self )
self.hover = false
end
local myText = vgui.Create("DTextEntry", bg)
myText:SetText("")
myText:SetPos( bg:GetWide() / 2 - 100, bg:GetTall() - 60 )
myText:SetSize( 200, 20 )
myText.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color(230,230,230))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local ybut = vgui.Create( "DButton", bg )
ybut:SetSize( 90, 30 )
ybut:SetPos( bg:GetWide() / 2 - 30, bg:GetTall() - 34 )
ybut:SetText( "Подтвердить" )
ybut:SetFont( "fontclose" )
ybut:SetTextColor( Color(255,255,255) )
ybut.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 36, 165, 221 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 16, 96, 130 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
ybut.DoClick = function()
local amt = myText:GetValue()
local str = cmd.." "..amt
if amt then
RunConsoleCommand( "say", str )
end
bg:Close()
textOpen = false
end
ybut.OnCursorEntered = function( self )
self.hover = true
end
ybut.OnCursorExited = function( self )
self.hover = false
end
end
function OpenPlyBox( text1, text2, cmd )
local bg = vgui.Create( "DFrame" )
bg:SetSize( 500, 150 )
bg:Center()
bg:MakePopup()
bg:SetTitle( "" )
bg:ShowCloseButton( false )
bg.Init = function(self)
self.startTime = SysTime()
end
bg.Paint = function( self, w, h )
Derma_DrawBackgroundBlur( self, self.startTime )
draw.RoundedBox( 0, 0, 0, w, h, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
draw.RoundedBox( 0, 0, 0, w, 50, Color( 23, 25, 37 ) )
draw.SimpleText( text1, "boxtitlef", 20, 15, Color( 255, 255, 255, 255 ) )
draw.SimpleText( text2, "boxmainf", w / 2, 62, Color( 0, 0, 0, 255 ), TEXT_ALIGN_CENTER )
end
textOpen = true
local cl = vgui.Create( "DButton", bg )
cl:SetSize( 50, 20 )
cl:SetPos( bg:GetWide() - 60, 0 )
cl:SetText( "X" )
cl:SetFont( "fontclose" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
local kcol
if self.hover then
kcol = Color( 255, 0, 0, 255 )
else
kcol = Color( 90, 0, 0 )
end
draw.RoundedBoxEx( 0, 0, 0, w, h, kcol, false, false, true, true )
end
cl.DoClick = function()
bg:Close()
textOpen = false
end
cl.OnCursorEntered = function( self )
self.hover = true
end
cl.OnCursorExited = function( self )
self.hover = false
end
local hl = vgui.Create( "DComboBox", bg)
hl:SetPos(bg:GetWide() / 2 - 100, 85)
hl:SetSize( 200, 20 )
for k,v in pairs(player.GetAll()) do
hl:AddChoice( v:Name() )
end
hl.OnSelect = function( panel, index, value, data )
target = string.Explode( " ", value )[1]
end
local ybut = vgui.Create( "DButton", bg )
ybut:SetSize( 90, 30 )
ybut:SetPos( bg:GetWide() / 2 - 30, bg:GetTall() - 34 )
ybut:SetText( "Подтвердить" )
ybut:SetFont( "fontclose" )
ybut:SetTextColor( Color(255,255,255) )
ybut.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 36, 165, 221 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 16, 96, 130 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
ybut.DoClick = function()
local str = cmd.." "..target
if target then
RunConsoleCommand( "say", str )
end
bg:Close()
textOpen = false
end
ybut.OnCursorEntered = function( self )
self.hover = true
end
ybut.OnCursorExited = function( self )
self.hover = false
end
end
function OpenPlyReasonBox( text1, text2, text3, cmd )
local bg = vgui.Create( "DFrame" )
bg:SetSize( 500, 218 )
bg:Center()
bg:MakePopup()
bg:SetTitle( "" )
bg:ShowCloseButton( false )
bg.Init = function(self)
self.startTime = SysTime()
end
bg.Paint = function( self, w, h )
Derma_DrawBackgroundBlur( self, self.startTime )
draw.RoundedBox( 0, 0, 0, w, h, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
draw.RoundedBox( 0, 0, 0, w, 50, Color( 23, 25, 37 ) )
draw.SimpleText( text1, "boxtitlef", 20, 15, Color( 255, 255, 255, 255 ) )
draw.SimpleText( text2, "boxmainf", w / 2, 60, Color( 0, 0, 0, 255 ), TEXT_ALIGN_CENTER )
draw.SimpleText( text3, "boxmainf", w / 2, 120, Color( 0, 0, 0, 255 ), TEXT_ALIGN_CENTER )
end
textOpen = true
local cl = vgui.Create( "DButton", bg )
cl:SetSize( 50, 20 )
cl:SetPos( bg:GetWide() - 60, 0 )
cl:SetText( "X" )
cl:SetFont( "fontclose" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
local kcol
if self.hover then
kcol = Color( 255, 0, 0, 255 )
else
kcol = Color( 90, 0, 0 )
end
draw.RoundedBoxEx( 0, 0, 0, w, h, kcol, false, false, true, true )
end
cl.DoClick = function()
bg:Close()
textOpen = false
end
cl.OnCursorEntered = function( self )
self.hover = true
end
cl.OnCursorExited = function( self )
self.hover = false
end
local target
local hl = vgui.Create( "DComboBox", bg)
hl:SetPos(bg:GetWide() / 2 - 100, 85)
hl:SetSize( 200, 20 )
for k,v in pairs(player.GetAll()) do
hl:AddChoice( v:Name() )
end
hl.OnSelect = function( panel, index, value, data )
target = string.Explode( " ", value )[1]
end
local myText = vgui.Create("DTextEntry", bg)
myText:SetText("")
myText:SetPos( bg:GetWide() / 2 - 100, bg:GetTall() - 74 )
myText:SetSize( 200, 20 )
myText.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color(230,230,230))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local ybut = vgui.Create( "DButton", bg )
ybut:SetSize( 90, 30 )
ybut:SetPos( bg:GetWide() / 2 - 30, bg:GetTall() - 34 )
ybut:SetText( "Подтвердить" )
ybut:SetFont( "fontclose" )
ybut:SetTextColor( Color(255,255,255) )
ybut.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 36, 165, 221 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 16, 96, 130 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
ybut.DoClick = function()
local amt = myText:GetValue()
local str = cmd.." "..target.." "..amt
if amt and target then
RunConsoleCommand( "say", str )
end
bg:Close()
textOpen = false
end
ybut.OnCursorEntered = function( self )
self.hover = true
end
ybut.OnCursorExited = function( self )
self.hover = false
end
end
local function firstToUpper(str) return (string.gsub( str, "^%l", string.upper)) end
function Pass() return end
local isOpen = false
local function HasStuff( list )
local stuff = #list:GetItems()
if stuff > 0 then return true elseif not stuff then return false end
end
local BACKGROUND
function timeToStr( time )
local tmp = time
local с = tmp % 60
tmp = math.floor( tmp / 60 )
local м = tmp % 60
tmp = math.floor( tmp / 60 )
local ч = tmp % 24
tmp = math.floor( tmp / 24 )
return string.format( "%2iч %02iм", ч, м )
end
local function formatNumber(n)
if not n then return "" end
if n >= 1e14 then return tostring(n) end
n = tostring(n)
local sep = sep or ","
local dp = string.find(n, "%.") or #n+1
for i=dp-4, 1, -3 do
n = n:sub(1, i) .. sep .. n:sub(i+1)
end
return n
end
local function ChangeJobVGUI()
isOpen = true
local jobs = team.GetAllTeams()
local bg = vgui.Create( "DFrame" )
bg:SetSize( 1000, 600 )
bg:Center()
bg:MakePopup()
bg:SetDraggable( false )
bg.Init = function(self)
self.startTime = SysTime()
end
bg.Paint = function(self, w, h)
Derma_DrawBackgroundBlur( self, self.startTime )
end
BACKGROUND = bg
local cp = vgui.Create( "DFrame", bg )
cp:SetSize( bg:GetWide() , bg:GetTall()-50 )
cp:SetPos( 0, 50 )
cp:ShowCloseButton( false )
cp:SetTitle( "" )
cp.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255 ) )
end
local cf = vgui.Create( "Panel", bg )
cf:SetSize( bg:GetWide(), 50 )
cf:SetPos( 0, 0 )
cf.Paint = function( self, w, h )
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 36, 38, 50 ), true, true, false, false )
end
local bbs
local jcol = Color( 92, 97, 111, 255 )
local mbg
local jbg
local ebg
local amm
local function OpenWebpage( title, webpage )
local cm = vgui.Create( "DFrame" )
cm:SetSize( 1040, 640 )
cm:Center()
cm:MakePopup()
cm:SetTitle( "" )
cm:ShowCloseButton( false )
cm.Init = function(self)
self.startTime = SysTime()
end
cm.Paint = function( self, w, h )
Derma_DrawBackgroundBlur( self, self.startTime )
draw.RoundedBox( 0, 0, 0, w, h, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
draw.RoundedBox( 0, 0, 0, w, 50, Color( 23, 25, 37 ) )
draw.SimpleText( title, "boxtitlef", 20, 15, Color( 255, 255, 255, 255 ) )
end
textOpen = true
local cl = vgui.Create( "DButton", cm )
cl:SetSize( 50, 20 )
cl:SetPos( cm:GetWide() - 60, 0 )
cl:SetText( "X" )
cl:SetFont( "fontclose" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
local kcol
if self.hover then
kcol = Color( 255, 0, 0, 255 )
else
kcol = Color( 100, 0, 0 )
end
draw.RoundedBoxEx( 0, 0, 0, w, h, kcol, false, false, true, true )
end
cl.DoClick = function()
cm:Close()
textOpen = false
end
cl.OnCursorEntered = function( self )
self.hover = true
end
cl.OnCursorExited = function( self )
self.hover = false
end
HTMLTest = vgui.Create("HTML", cm)
HTMLTest:SetPos(0,50)
HTMLTest:SetSize(cm:GetWide(), cm:GetTall() - 50)
HTMLTest:OpenURL(webpage)
end
-- Главная
local function OpenCmds()
mbg = vgui.Create( "DFrame", cp )
mbg:SetSize( bg:GetWide() , bg:GetTall() - 50 )
mbg:SetPos( 0, 0 )
mbg:ShowCloseButton( false )
mbg:SetTitle( "" )
mbg.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
local plym = vgui.Create( "DFrame", mbg )
plym:SetSize( 380, 120 )
plym:SetPos( 4, 4 )
plym:ShowCloseButton( false )
plym:SetTitle( "" )
plym.Paint = function( self, w, h )
draw.RoundedBox( 6, 0, 0, w, h, Color( 200, 200, 200) )
draw.RoundedBox( 6, 1, 1, w-2, h-2, Color( 255, 255, 255) )
draw.SimpleText( LocalPlayer():Name(), "plyname", 120, 15, Color( 47, 150, 217 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Наличные: "..formatNumber(LocalPlayer():getDarkRPVar("money") or 0).." р.", "boxmainf", 120, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Профессия: "..LocalPlayer():getDarkRPVar("job"), "boxmainf", 120, 60, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
if LocalPlayer():getDarkRPVar("salary") > 0 then
draw.SimpleText( "Зарплата: "..formatNumber(LocalPlayer():getDarkRPVar("salary") or 0).." р.", "boxmainf", 120, 80, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT ) end
end
local Avatar = vgui.Create( "AvatarImage", mbg )
Avatar:SetSize( 100, 100 )
Avatar:SetPos( 14, 14 )
Avatar:SetPlayer( LocalPlayer(), 100 )
local mnym = vgui.Create( "DFrame", mbg )
mnym:SetSize( 380, 180 )
mnym:SetPos( 4, 128 )
mnym:ShowCloseButton( false )
mnym:SetTitle( "" )
mnym.Paint = function( self, w, h )
draw.RoundedBox( 6, 0, 0, w, h, Color( 200, 200, 200) )
draw.RoundedBox( 6, 1, 1, w-2, h-2, Color( 255, 255, 255) )
draw.SimpleText( "Операции с деньгами", "plyname", w/2, 10, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
draw.SimpleText( "Бросить деньги", "boxmainf", 10, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Дать деньги", "boxmainf", 10, 103, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
end
local drme = vgui.Create("DTextEntry", mnym)
drme:SetText("")
drme:SetFont("boxmainf")
drme:SetPos( 9, 59 )
drme:SetSize( 250, 30)
drme.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите сумму...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local drmm = vgui.Create( "DButton", mnym )
drmm:SetSize( 108, 30 )
drmm:SetPos( 263, 59 )
drmm:SetText( "OK" )
drmm:SetFont( "boxmainf" )
drmm:SetTextColor( Color(255,255,255) )
drmm.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
drmm.DoClick = function() if drme:GetValue() then RunConsoleCommand( "say", "/moneydrop "..drme:GetValue() ) bg:Close() isOpen = false textOpen = false end end
drmm.OnCursorEntered = function( self ) self.hover = true end
drmm.OnCursorExited = function( self ) self.hover = false end
local gvme = vgui.Create("DTextEntry", mnym)
gvme:SetText("")
gvme:SetFont("boxmainf")
gvme:SetPos( 9, 122 )
gvme:SetSize( 250, 30)
gvme.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите сумму...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local gvmm = vgui.Create( "DButton", mnym )
gvmm:SetSize( 108, 30 )
gvmm:SetPos( 263, 122 )
gvmm:SetText( "OK" )
gvmm:SetFont( "boxmainf" )
gvmm:SetTextColor( Color(255,255,255) )
gvmm.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
gvmm.DoClick = function() if gvme:GetValue() then RunConsoleCommand( "say", "/give "..gvme:GetValue() ) bg:Close() isOpen = false textOpen = false end end
gvmm.OnCursorEntered = function( self ) self.hover = true end
gvmm.OnCursorExited = function( self ) self.hover = false end
local xerna = vgui.Create( "DFrame", mbg )
xerna:SetSize( 380, 234 )
xerna:SetPos( 4, 312 )
xerna:ShowCloseButton( false )
xerna:SetTitle( "" )
xerna.Paint = function( self, w, h )
draw.RoundedBox( 6, 0, 0, w, h, Color( 200, 200, 200) )
draw.RoundedBox( 6, 1, 1, w-2, h-2, Color( 255, 255, 255) )
draw.SimpleText( "Другие команды", "plyname", w/2, 10, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
draw.SimpleText( "Написать объявление (/объявление)", "boxmainf", 10, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "RP действие персонажа (/me)", "boxmainf", 10, 103, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Позвать администратора (@)", "boxmainf", 10, 166, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
end
local adve = vgui.Create("DTextEntry", xerna)
adve:SetText("")
adve:SetFont("boxmainf")
adve:SetPos( 9, 59 )
adve:SetSize( 250, 30)
adve.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите текст...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb = vgui.Create( "DButton", xerna )
advb:SetSize( 108, 30 )
advb:SetPos( 263, 59 )
advb:SetText( "OK" )
advb:SetFont( "boxmainf" )
advb:SetTextColor( Color(255,255,255) )
advb.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb.DoClick = function() if adve:GetValue() then RunConsoleCommand( "say", "/advert "..adve:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb.OnCursorEntered = function( self ) self.hover = true end
advb.OnCursorExited = function( self ) self.hover = false end
local mem = vgui.Create("DTextEntry", xerna)
mem:SetText("")
mem:SetFont("boxmainf")
mem:SetPos( 9, 122 )
mem:SetSize( 250, 30)
mem.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите текст...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local meb = vgui.Create( "DButton", xerna )
meb:SetSize( 108, 30 )
meb:SetPos( 263, 122 )
meb:SetText( "OK" )
meb:SetFont( "boxmainf" )
meb:SetTextColor( Color(255,255,255) )
meb.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
meb.DoClick = function() if mem:GetValue() then RunConsoleCommand( "say", "/me "..mem:GetValue() ) bg:Close() isOpen = false textOpen = false end end
meb.OnCursorEntered = function( self ) self.hover = true end
meb.OnCursorExited = function( self ) self.hover = false end
local adme = vgui.Create("DTextEntry", xerna)
adme:SetText("")
adme:SetFont("boxmainf")
adme:SetPos( 9, 185 )
adme:SetSize( 250, 30)
adme.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите текст...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local admb = vgui.Create( "DButton", xerna )
admb:SetSize( 108, 30 )
admb:SetPos( 263, 185 )
admb:SetText( "OK" )
admb:SetFont( "boxmainf" )
admb:SetTextColor( Color(255,255,255) )
admb.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
admb.DoClick = function() if adme:GetValue() then RunConsoleCommand( "say", "@ "..adme:GetValue() ) bg:Close() isOpen = false textOpen = false end end
admb.OnCursorEntered = function( self ) self.hover = true end
admb.OnCursorExited = function( self ) self.hover = false end
// КОНТЕЙНЕР #2 //
-- СТОЛБ 1 --
local xerna2 = vgui.Create( "DFrame", mbg )
xerna2:SetSize( 608, 269 )
xerna2:SetPos( 388, 4 )
xerna2:ShowCloseButton( false )
xerna2:SetTitle( "" )
xerna2.Paint = function( self, w, h )
draw.RoundedBox( 6, 0, 0, w, h, Color( 200, 200, 200) )
draw.RoundedBox( 6, 1, 1, w-2, h-2, Color( 255, 255, 255) )
draw.SimpleText( "Основные команды", "plyname", w/2, 10, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
draw.SimpleText( "Уволить игрока", "boxmainf", 10, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
end
local hl = vgui.Create( "DComboBox", xerna2)
hl:SetPos( 9, 59 )
hl:SetSize( 150, 30)
hl:SetFont("boxmainf")
for k,v in pairs(player.GetAll()) do hl:AddChoice( v:Name() ) end
hl.OnSelect = function( panel, index, value, data ) target = string.Explode( " ", value )[1] end
hl.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
--draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )
end
local adve2 = vgui.Create("DTextEntry", xerna2)
adve2:SetText("")
adve2:SetFont("boxmainf")
adve2:SetPos( 163, 59 )
adve2:SetSize( 324, 30)
adve2.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb2 = vgui.Create( "DButton", xerna2 )
advb2:SetSize( 108, 30 )
advb2:SetPos( 491, 59 )
advb2:SetText( "OK" )
advb2:SetFont( "boxmainf" )
advb2:SetTextColor( Color(255,255,255) )
advb2.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb2.DoClick = function() if adve2:GetValue() and target then RunConsoleCommand( "say", "/demote "..target.." "..adve2:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb2.OnCursorEntered = function( self ) self.hover = true end
advb2.OnCursorExited = function( self ) self.hover = false end
local btn1 = vgui.Create( "DButton", xerna2 )
btn1:SetSize( 293, 30 )
btn1:SetPos( 9, 93 )
btn1:SetText( "Выкинуть оружие" )
btn1:SetFont( "boxmainf" )
btn1:SetTextColor( Color(255,255,255) )
btn1.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
btn1.DoClick = function() RunConsoleCommand( "say", "/drop" ) bg:Close() isOpen = false textOpen = false end
btn1.OnCursorEntered = function( self ) self.hover = true end
btn1.OnCursorExited = function( self ) self.hover = false end
local btn2 = vgui.Create( "DButton", xerna2 )
btn2:SetSize( 293, 30 )
btn2:SetPos( 306, 93 )
btn2:SetText( "Запросить лицензию" )
btn2:SetFont( "boxmainf" )
btn2:SetTextColor( Color(255,255,255) )
btn2.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
btn2.DoClick = function() RunConsoleCommand( "say", "/requestlicense" ) bg:Close() isOpen = false textOpen = false end
btn2.OnCursorEntered = function( self ) self.hover = true end
btn2.OnCursorExited = function( self ) self.hover = false end
local btn3 = vgui.Create( "DButton", xerna2 )
btn3:SetSize( 293, 30 )
btn3:SetPos( 9, 127 )
btn3:SetText( "Меню банды" )
btn3:SetFont( "boxmainf" )
btn3:SetTextColor( Color(255,255,255) )
btn3.Paint = function( self, w, h ) if LocalPlayer():GetNWString("Gang","") == "" then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 180, 180, 180 ))
else
if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end end
btn3.DoClick = function() if LocalPlayer():GetNWString("Gang","") != "" then RunConsoleCommand( "say", "!gang" ) bg:Close() isOpen = false textOpen = false end end
btn3.OnCursorEntered = function( self ) self.hover = true end
btn3.OnCursorExited = function( self ) self.hover = false end
local btn4 = vgui.Create( "DButton", xerna2 )
btn4:SetSize( 293, 30 )
btn4:SetPos( 306, 127 )
btn4:SetText( "Продать все двери" )
btn4:SetFont( "boxmainf" )
btn4:SetTextColor( Color(255,255,255) )
btn4.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
btn4.DoClick = function() RunConsoleCommand( "say", "/unownalldoors" ) bg:Close() isOpen = false textOpen = false end
btn4.OnCursorEntered = function( self ) self.hover = true end
btn4.OnCursorExited = function( self ) self.hover = false end
local rtn1 = vgui.Create( "DButton", xerna2 )
rtn1:SetSize( 293, 50 )
rtn1:SetPos( 9, 161 )
rtn1:SetText( "Правила" )
rtn1:SetFont( "boxmainf" )
rtn1:SetTextColor( Color( 36, 38, 50 ) )
rtn1.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
rtn1:SetTextColor( Color(255,255,255) )
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
rtn1:SetTextColor( Color( 36, 38, 50 ) ) end end
rtn1.DoClick = function() OpenWebpage("Gmod-Best.Ru > Правила", "https://gmod-best.ru/forum/index.php?pages/darkrp_rules/") bg:Close() isOpen = false textOpen = false end
rtn1.OnCursorEntered = function( self ) self.hover = true end
rtn1.OnCursorExited = function( self ) self.hover = false end
local rtn2 = vgui.Create( "DButton", xerna2 )
rtn2:SetSize( 293, 50 )
rtn2:SetPos( 306, 161 )
rtn2:SetText( "Донат" )
rtn2:SetFont( "boxmainf" )
rtn2:SetTextColor( Color( 36, 38, 50 ) )
rtn2.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
rtn2:SetTextColor( Color(255,255,255) )
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
rtn2:SetTextColor( Color( 36, 38, 50 ) ) end end
rtn2.DoClick = function() OpenWebpage("Gmod-Best.Ru > Донат", "https://gmod-best.ru/forum/index.php?threads/darkrp-donat.813/") bg:Close() isOpen = false textOpen = false end
rtn2.OnCursorEntered = function( self ) self.hover = true end
rtn2.OnCursorExited = function( self ) self.hover = false end
local rtn3 = vgui.Create( "DButton", xerna2 )
rtn3:SetSize( 293, 50 )
rtn3:SetPos( 9, 215 )
rtn3:SetText( "Форум" )
rtn3:SetFont( "boxmainf" )
rtn3:SetTextColor( Color( 36, 38, 50 ) )
rtn3.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
rtn3:SetTextColor( Color(255,255,255) )
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
rtn3:SetTextColor( Color( 36, 38, 50 ) ) end end
rtn3.DoClick = function() OpenWebpage("Gmod-Best.Ru", "https://gmod-best.ru/forum/") bg:Close() isOpen = false textOpen = false end
rtn3.OnCursorEntered = function( self ) self.hover = true end
rtn3.OnCursorExited = function( self ) self.hover = false end
local rtn4 = vgui.Create( "DButton", xerna2 )
rtn4:SetSize( 293, 50 )
rtn4:SetPos( 306, 215 )
rtn4:SetText( "ВИКИ" )
rtn4:SetFont( "boxmainf" )
rtn4:SetTextColor( Color( 36, 38, 50 ) )
rtn4.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
rtn4:SetTextColor( Color(255,255,255) )
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color(255,255,255))
rtn4:SetTextColor( Color( 36, 38, 50 ) ) end end
rtn4.DoClick = function() OpenWebpage("Gmod-Best.Ru > ВИКИ", "https://gmod-best.ru/forum/index.php?wiki/index/") bg:Close() isOpen = false textOpen = false end
rtn4.OnCursorEntered = function( self ) self.hover = true end
rtn4.OnCursorExited = function( self ) self.hover = false end
-- СТОЛБ 2 --
local xerna3 = vgui.Create( "DFrame", mbg )
xerna3:SetSize( 608, 269 )
xerna3:SetPos( 388, 277 )
xerna3:ShowCloseButton( false )
xerna3:SetTitle( "" )
xerna3.Paint = function( self, w, h )
draw.RoundedBox( 6, 0, 0, w, h, Color( 200, 200, 200) )
draw.RoundedBox( 6, 1, 1, w-2, h-2, Color( 255, 255, 255) )
if LocalPlayer():Team() == TEAM_POLICE or LocalPlayer():Team() == TEAM_SWAT or LocalPlayer():Team() == TEAM_CHIEF then
draw.SimpleText( "Команды полиции", "plyname", w/2, 10, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
draw.SimpleText( "Розыск", "boxmainf", 10, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Выписать ордер на обыск", "boxmainf", 10, 103, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
elseif LocalPlayer():Team() == TEAM_MAYOR then
draw.SimpleText( "Команды мэра", "plyname", w/2, 10, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
draw.SimpleText( "Комендантский час", "boxmainf", 10, 40, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Выписать ордер на обыск", "boxmainf", 10, 103, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
draw.SimpleText( "Розыск", "boxmainf", 10, 166, Color( 0, 0, 0, 250 ), TEXT_ALIGN_LEFT )
else
draw.SimpleText( "Специализированые команды", "plyname", w/2, h/2-10, Color( 150, 150, 150 ), TEXT_ALIGN_CENTER )
end
end
-- Мэр --
if LocalPlayer():Team() == TEAM_MAYOR then
local locke = vgui.Create("DTextEntry", xerna3)
locke:SetText("")
locke:SetFont("boxmainf")
locke:SetPos( 9, 59 )
locke:SetSize( 350, 30)
locke.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local lockb = vgui.Create( "DButton", xerna3 )
lockb:SetSize( 116, 30 )
lockb:SetPos( 363, 59 )
lockb:SetText( "Начать" )
lockb:SetFont( "boxmainf" )
lockb:SetTextColor( Color(255,255,255) )
lockb.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
lockb.DoClick = function() if locke:GetValue() != "" then
RunConsoleCommand( "say", "/lockdown /новости "..locke:GetValue() )
bg:Close() isOpen = false textOpen = false end end
lockb.OnCursorEntered = function( self ) self.hover = true end
lockb.OnCursorExited = function( self ) self.hover = false end
local unlkb = vgui.Create( "DButton", xerna3 )
unlkb:SetSize( 116, 30 )
unlkb:SetPos( 483, 59 )
unlkb:SetText( "Остановить" )
unlkb:SetFont( "boxmainf" )
unlkb:SetTextColor( Color(255,255,255) )
unlkb.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
unlkb.DoClick = function() RunConsoleCommand( "say", "/unlockdown ") bg:Close() isOpen = false textOpen = false end
unlkb.OnCursorEntered = function( self ) self.hover = true end
unlkb.OnCursorExited = function( self ) self.hover = false end
local hl2 = vgui.Create( "DComboBox", xerna3)
hl2:SetPos( 9, 122 )
hl2:SetSize( 150, 30)
hl2:SetFont("boxmainf")
for k,v in pairs(player.GetAll()) do hl2:AddChoice( v:Name() ) end
hl2.OnSelect = function( panel, index, value, data ) target = string.Explode( " ", value )[1] end
hl2.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
--draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )
end
local adve3 = vgui.Create("DTextEntry", xerna3)
adve3:SetText("")
adve3:SetFont("boxmainf")
adve3:SetPos( 163, 122 )
adve3:SetSize( 324, 30)
adve3.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb3 = vgui.Create( "DButton", xerna3 )
advb3:SetSize( 108, 30 )
advb3:SetPos( 491, 122 )
advb3:SetText( "OK" )
advb3:SetFont( "boxmainf" )
advb3:SetTextColor( Color(255,255,255) )
advb3.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb3.DoClick = function() if adve3:GetValue() and target then RunConsoleCommand( "say", "/warrant "..target.." "..adve3:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb3.OnCursorEntered = function( self ) self.hover = true end
advb3.OnCursorExited = function( self ) self.hover = false end
local hl3 = vgui.Create( "DComboBox", xerna3)
hl3:SetPos( 9, 185 )
hl3:SetSize( 150, 30)
hl3:SetFont("boxmainf")
for k,v in pairs(player.GetAll()) do hl3:AddChoice( v:Name() ) end
hl3.OnSelect = function( panel, index, value, data ) target = string.Explode( " ", value )[1] end
hl3.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
--draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )
end
local adve4 = vgui.Create("DTextEntry", xerna3)
adve4:SetText("")
adve4:SetFont("boxmainf")
adve4:SetPos( 163, 185 )
adve4:SetSize( 250, 30)
adve4.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb4 = vgui.Create( "DButton", xerna3 )
advb4:SetSize( 89, 30 )
advb4:SetPos( 417, 185 )
advb4:SetText( "Подать" )
advb4:SetFont( "boxmainf" )
advb4:SetTextColor( Color(255,255,255) )
advb4.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb4.DoClick = function() if adve4:GetValue() and target then RunConsoleCommand( "say", "/wanted "..target.." "..adve4:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb4.OnCursorEntered = function( self ) self.hover = true end
advb4.OnCursorExited = function( self ) self.hover = false end
local advb5 = vgui.Create( "DButton", xerna3 )
advb5:SetSize( 89, 30 )
advb5:SetPos( 510, 185 )
advb5:SetText( "Убрать" )
advb5:SetFont( "boxmainf" )
advb5:SetTextColor( Color(255,255,255) )
advb5.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb5.DoClick = function() if adve4:GetValue() and target then RunConsoleCommand( "say", "/unwanted "..target ) bg:Close() isOpen = false textOpen = false end end
advb5.OnCursorEntered = function( self ) self.hover = true end
advb5.OnCursorExited = function( self ) self.hover = false end
local rtn5 = vgui.Create( "DButton", xerna3 )
rtn5:SetSize( 590, 30 )
rtn5:SetPos( 9, 225 )
rtn5:SetText( "Выдать лицензию" )
rtn5:SetFont( "boxmainf" )
rtn5:SetTextColor( Color(255,255,255) )
rtn5.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
rtn5.DoClick = function() RunConsoleCommand( "say", "/givelicense" ) bg:Close() isOpen = false textOpen = false end
rtn5.OnCursorEntered = function( self ) self.hover = true end
rtn5.OnCursorExited = function( self ) self.hover = false end
end -- Мэр конец --
-- Полиция --
if LocalPlayer():Team() == TEAM_POLICE or LocalPlayer():Team() == TEAM_SWAT or LocalPlayer():Team() == TEAM_CHIEF then
local hl2 = vgui.Create( "DComboBox", xerna3)
hl2:SetPos( 9, 122 )
hl2:SetSize( 150, 30)
hl2:SetFont("boxmainf")
for k,v in pairs(player.GetAll()) do hl2:AddChoice( v:Name() ) end
hl2.OnSelect = function( panel, index, value, data ) target = string.Explode( " ", value )[1] end
hl2.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
--draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )
end
local adve3 = vgui.Create("DTextEntry", xerna3)
adve3:SetText("")
adve3:SetFont("boxmainf")
adve3:SetPos( 163, 122 )
adve3:SetSize( 324, 30)
adve3.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb3 = vgui.Create( "DButton", xerna3 )
advb3:SetSize( 108, 30 )
advb3:SetPos( 491, 122 )
advb3:SetText( "OK" )
advb3:SetFont( "boxmainf" )
advb3:SetTextColor( Color(255,255,255) )
advb3.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb3.DoClick = function() if adve3:GetValue() and target then RunConsoleCommand( "say", "/warrant "..target.." "..adve3:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb3.OnCursorEntered = function( self ) self.hover = true end
advb3.OnCursorExited = function( self ) self.hover = false end
local hl3 = vgui.Create( "DComboBox", xerna3)
hl3:SetPos( 9, 59 )
hl3:SetSize( 150, 30)
hl3:SetFont("boxmainf")
for k,v in pairs(player.GetAll()) do hl3:AddChoice( v:Name() ) end
hl3.OnSelect = function( panel, index, value, data ) target = string.Explode( " ", value )[1] end
hl3.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
--draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )
end
local adve4 = vgui.Create("DTextEntry", xerna3)
adve4:SetText("")
adve4:SetFont("boxmainf")
adve4:SetPos( 163, 59 )
adve4:SetSize( 250, 30)
adve4.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите причину...", "boxmainf", 4, 7, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
local advb4 = vgui.Create( "DButton", xerna3 )
advb4:SetSize( 89, 30 )
advb4:SetPos( 417, 59 )
advb4:SetText( "Подать" )
advb4:SetFont( "boxmainf" )
advb4:SetTextColor( Color(255,255,255) )
advb4.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb4.DoClick = function() if adve4:GetValue() and target then RunConsoleCommand( "say", "/wanted "..target.." "..adve4:GetValue() ) bg:Close() isOpen = false textOpen = false end end
advb4.OnCursorEntered = function( self ) self.hover = true end
advb4.OnCursorExited = function( self ) self.hover = false end
local advb5 = vgui.Create( "DButton", xerna3 )
advb5:SetSize( 89, 30 )
advb5:SetPos( 510, 59 )
advb5:SetText( "Убрать" )
advb5:SetFont( "boxmainf" )
advb5:SetTextColor( Color(255,255,255) )
advb5.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
advb5.DoClick = function() if adve4:GetValue() and target then RunConsoleCommand( "say", "/unwanted "..target ) bg:Close() isOpen = false textOpen = false end end
advb5.OnCursorEntered = function( self ) self.hover = true end
advb5.OnCursorExited = function( self ) self.hover = false end
local rtn5 = vgui.Create( "DButton", xerna3 )
rtn5:SetSize( 590, 30 )
rtn5:SetPos( 9, 165 )
rtn5:SetText( "Выдать лицензию" )
rtn5:SetFont( "boxmainf" )
rtn5:SetTextColor( Color(255,255,255) )
rtn5.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
else
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
rtn5.DoClick = function() RunConsoleCommand( "say", "/givelicense" ) bg:Close() isOpen = false textOpen = false end
rtn5.OnCursorEntered = function( self ) self.hover = true end
rtn5.OnCursorExited = function( self ) self.hover = false end
end -- Мэр конец --
end //-- Конец фрейма --//
-- Профессии
local function OpenJobs()
jbg = vgui.Create( "DFrame", cp )
jbg:SetSize( bg:GetWide() , bg:GetTall() - 50 )
jbg:SetPos( 0, 0 )
jbg:ShowCloseButton( false )
jbg:SetTitle( "" )
jbg.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
main = vgui.Create( "DPanelList", jbg )
main:SetSize( 688, jbg:GetTall() - 18 )
main:SetSpacing( 0 )
main:SetPos( 304, 9 )
main:EnableVerticalScrollbar( true )
main.Paint = function( s, w, h ) draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,0))end
main.VBar.Paint = function( s, w, h ) draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,70)) end
main.VBar.btnUp.Paint = function( s, w, h ) end
main.VBar.btnDown.Paint = function( s, w, h ) end
main.VBar.btnGrip.Paint = function( s, w, h )draw.RoundedBox( 4, 5, 0, 4, h+22, Color(0,0,0,70)) end
main2 = vgui.Create( "DPanelList", jbg )
main2:SetSize( 290, jbg:GetTall() - 60 )
main2:SetSpacing( 0 )
main2:SetPos( 9, 56 )
main2.Paint = function( s, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color(0,0,0,0))end
local function AddJobInfo( v )
local dc = string.Implode( " ", string.Explode( " ", v.description))
local real
if string.len( dc ) > 520 then real = string.sub( dc, 1, 520 )..".." else real = dc end
local lab = vgui.Create( "DFrame", main2 )
lab:SetSize( main2:GetWide(), main2:GetTall() )
lab:SetTitle( "" )
lab:ShowCloseButton( false )
lab:SetDraggable( false )
lab.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 10, 10 )
namel:SetText( v.name )
namel:SetFont( "jobtitlef" )
namel:SetTextColor( Color(0,0,0,200) )
namel:SizeToContents()
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 9 )
namel:SetText( v.name )
namel:SetFont( "jobtitlef" )
namel:SetTextColor( v.color )
namel:SizeToContents()
if v.vip == 1 then
local imagevv = vgui.Create( "DImage", lab )
imagevv:SetPos( namel:GetWide() + 20, 15 )
imagevv:SetSize( 16, 16 )
imagevv:SetImage( "icon16/award_star_gold_2.png" )
imagevv:SizeToContents()
local labvv = vgui.Create( "DLabel", lab )
labvv:SetPos( namel:GetWide() + 41, 15 )
labvv:SetText( "V.I.P." )
labvv:SetFont( "jobmainf" )
labvv:SetTextColor( Color (0, 0, 0, 255) )
labvv:SizeToContents()
end
local total = team.NumPlayers( v.team ) local maxpl = "Лимит: "..v.max local zp = "р." local selp = v.salary
local jt = "Мирная" local jhw = "Без особого оружия"
if v.max <= 0 then maxpl = "Неограничено" end if v.salary <= 0 then selp = "Нет" zp = "" end
if type(v.weapons) == "table" and table.Count( v.weapons ) > 1 and v.cp == 1 then jhw = "Табельное оружие" end
if type(v.weapons) == "table" and table.Count( v.weapons ) > 1 and v.cp == 1 and v.medic then jhw = "Без особого оружия" end
if type(v.weapons) == "table" and table.Count( v.weapons ) > 1 and v.cp == 2 then jhw = "Особое оружие" end
if type(v.weapons) == "table" and table.Count( v.weapons ) > 1 and v.cp == 3 then jhw = "Админское оружие" end
if v.cp == 1 then jt = "Государственная" elseif v.cp == 2 then jt = "Нелегальная" elseif v.cp == 3 then jt = "Не влияет на рп" else jt = "Мирная" end
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 36 )
namel:SetText( "Тип: "..jt )
namel:SetFont( "entmainf" )
namel:SetTextColor( Color(0,0,0) )
namel:SizeToContents()
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 56 )
namel:SetText( "Оружие: "..jhw )
namel:SetFont( "entmainf" )
namel:SetTextColor( Color(0,0,0) )
namel:SizeToContents()
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 76 )
namel:SetText( maxpl )
namel:SetFont( "entmainf" )
namel:SetTextColor( Color(0,0,0) )
namel:SizeToContents()
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 96 )
namel:SetText( "Зарплата: "..selp )
namel:SetFont( "entmainf" )
namel:SetTextColor( Color(0,0,0) )
namel:SizeToContents()
local desc = vgui.Create( "DLabel", lab )
desc:SetPos( 9, 120 )
desc:SetSize( 281, 300 )
desc:SetTextColor( Color( 0, 0, 0, 255 ) )
desc:SetWrap( true )
desc:SetFont( "jobmainf" )
desc:SetText( real )
desc:SetAutoStretchVertical( true )
if v.forumlink then
local drmm = vgui.Create( "DButton", lab )
drmm:SetSize( 272, 30 )
drmm:SetPos( 9, lab:GetTall() - 93 )
drmm:SetText( "Гайд" )
drmm:SetFont( "boxmainf" )
drmm:SetTextColor( Color( 36, 38, 50 ) )
drmm.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255 )) end end
drmm.DoClick = function() OpenWebpage( "Гайд по професии ".. v.name , v.forumlink ) bg:Close() isOpen = false textOpen = false end
drmm.OnCursorEntered = function( self ) drmm:SetTextColor( Color( 255, 255, 255 ) ) self.hover = true end
drmm.OnCursorExited = function( self ) drmm:SetTextColor( Color( 36, 38, 50 ) ) self.hover = false end
end
local afj = vgui.Create( "DButton", lab )
afj:SetSize( 272, 50 )
afj:SetPos( 9, lab:GetTall() - 59 )
afj:SetText( "ВЫБРАТЬ" )
afj:SetFont( "boxmainf" )
afj:SetTextColor( Color( 255, 255, 255, 255 ) )
afj.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
afj.DoClick = function( self ) bg:Close() if v.vote or v.RequiresVote and v.RequiresVote(LocalPlayer(), v.team) then RunConsoleCommand( "say", t .. v.command ) else RunConsoleCommand( "say", "/"..v.command ) end end
afj.OnCursorEntered = function( self ) self.hover = true end
afj.OnCursorExited = function( self ) self.hover = false end
if v.vote or v.RequiresVote and v.RequiresVote(LocalPlayer(), v.team) then afj:SetText( vt ) else afj:SetText( "ВЫБРАТЬ" ) end
main2:AddItem( lab )
end
local function AddJobPanel( v )
local jobc = vgui.Create( "DFrame", main )
jobc:SetSize( main:GetWide(), 60 )
jobc:SetTitle( "" )
jobc:ShowCloseButton( false )
jobc:SetDraggable( false )
jobc.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h + 20, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 255, 255, 255, 255 ) )
draw.RoundedBox( 0, w-6, 1, 5 , h-2, v.color )
end
local lab = vgui.Create( "DLabel", jobc )
lab:SetPos( 9, 20 )
lab:SetText( v.name )
lab:SetFont( "jobtitlef" )
lab:SetTextColor( v.color )
lab:SizeToContents()
local sel = vgui.Create( "DButton", jobc )
sel:SetSize( jobc:GetWide(), jobc:GetTall() )
sel:SetPos( 0, 0 )
sel:SetText( "" )
sel.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
sel.DoClick = function( self ) main2:Clear() AddJobInfo( v ) end
main:AddItem( jobc )
end
local adve4 = vgui.Create("DTextEntry", jbg)
adve4:SetText("")
adve4:SetFont("boxmainf")
adve4:SetPos( 9, 9 )
adve4:SetSize( 257, 36)
adve4.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите фильтр...", "boxmainf", 4, 11, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
adve4.OnEnter = function()
main:Clear()
for key, hh in pairs( RPExtraTeams ) do local check = hh.customCheck or function( ply ) return true end
if LocalPlayer():IsAdmin() then vt = "ВЫБРАТЬ" t = "/" else vt = "Голосование" t = "/vote" end if LocalPlayer():Team() == hh.NeedToChangeFrom || !hh.NeedToChangeFrom then
if check( LocalPlayer() ) then if string.find(string.lower(hh.name), string.lower(adve4:GetValue()), 1, true) then AddJobPanel( hh ) end end end end end
local advb4 = vgui.Create( "DButton", jbg )
advb4:SetSize( 34, 36 )
advb4:SetPos( 266, 9 )
advb4:SetText( "" )
advb4.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 1, 0, w-1, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
surface.SetMaterial(Material("gui/html/refresh.vtf"))
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(1,2,32,32)
else draw.RoundedBox( 4, 1, 0, w-1, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 ))
surface.SetMaterial(Material("gui/html/refresh.vtf"))
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(1,2,32,32)
end end
advb4.DoClick = function() main:Clear()
for key, hh in pairs( RPExtraTeams ) do local check = hh.customCheck or function( ply ) return true end
if LocalPlayer():IsAdmin() then vt = "ВЫБРАТЬ" t = "/" else vt = "Голосование" t = "/vote" end if LocalPlayer():Team() == hh.NeedToChangeFrom || !hh.NeedToChangeFrom then
if check( LocalPlayer() ) then if string.find(string.lower(hh.name), string.lower(adve4:GetValue()), 1, true) then AddJobPanel( hh ) end end end end end
advb4.OnCursorEntered = function( self ) self.hover = true end
advb4.OnCursorExited = function( self ) self.hover = false end
for key, job in pairs( RPExtraTeams ) do
if job.name == "Гражданин" then AddJobInfo( job ) end
local check = job.customCheck or function( ply ) return true end
if LocalPlayer():IsAdmin() then vt = "ВЫБРАТЬ" t = "/" else vt = "Голосование" t = "/vote" end
if LocalPlayer():Team() == job.NeedToChangeFrom || !job.NeedToChangeFrom then
if check( LocalPlayer() ) then
AddJobPanel( job )
end
end
end
end -- КОНЕЦ ВТОРОГО УЗЛА
-- Магазин
local function OpenEnts()
ebg = vgui.Create( "DFrame", cp )
ebg:SetSize( bg:GetWide() , bg:GetTall() - 50 )
ebg:SetPos( 0, 0 )
ebg:ShowCloseButton( false )
ebg:SetTitle( "" )
ebg.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 232, 234, 236, 0 ) ) end
local main = vgui.Create( "DPanelList", ebg )
main:SetSize( ebg:GetWide(), ebg:GetTall() )
main:SetPos( 0, 0 )
main:EnableVerticalScrollbar( true )
main.Paint = function( s, w, h )
draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,70))
draw.RoundedBox( 4, 0, 0, w, h, Color( 232, 234, 236, 255 ))
end
main.VBar.Paint = function( s, w, h )
draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,70))
end
main.VBar.btnUp.Paint = function( s, w, h ) end
main.VBar.btnDown.Paint = function( s, w, h ) end
main.VBar.btnGrip.Paint = function( s, w, h )
draw.RoundedBox( 4, 5, 0, 4, h+22, Color(0,0,0,70))
end
main = vgui.Create( "DPanelList", ebg )
main:SetSize( 688, ebg:GetTall() - 18 )
main:SetSpacing( 0 )
main:SetPos( 304, 9 )
main:EnableVerticalScrollbar( true )
main.Paint = function( s, w, h ) draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,0))end
main.VBar.Paint = function( s, w, h ) draw.RoundedBox( 4, 3, 13, 8, h-24, Color(0,0,0,70)) end
main.VBar.btnUp.Paint = function( s, w, h ) end
main.VBar.btnDown.Paint = function( s, w, h ) end
main.VBar.btnGrip.Paint = function( s, w, h )draw.RoundedBox( 4, 5, 0, 4, h+22, Color(0,0,0,70)) end
main2 = vgui.Create( "DPanelList", ebg )
main2:SetSize( 290, ebg:GetTall() - 60 )
main2:SetSpacing( 0 )
main2:SetPos( 9, 56 )
main2.Paint = function( s, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color(0,0,0,0))end
local function AddJobInfo( ent )
local lab = vgui.Create( "DFrame", main2 )
lab:SetSize( main2:GetWide(), main2:GetTall() )
lab:SetTitle( "" )
lab:ShowCloseButton( false )
lab:SetDraggable( false )
lab.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
local icon = vgui.Create("SpawnIcon", lab)
icon:SetPos( lab:GetWide() - 69, 40)
icon:SetSize( 60, 60 )
icon:SetModel(ent.model)
local lab2 = vgui.Create( "DFrame", lab )
lab2:SetSize( icon:GetWide(), icon:GetTall() )
lab2:SetPos( lab:GetWide() - 69, 40)
lab2:SetTitle( "" )
lab2:ShowCloseButton( false )
lab2:SetDraggable( false )
lab2.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
local namel = vgui.Create( "DLabel", lab )
namel:SetPos( 9, 9 )
namel:SetText( ent.name )
namel:SetFont( "jobtitlef" )
namel:SetTextColor( Color( 47, 150, 217 ) )
namel:SizeToContents()
local desc = vgui.Create( "DLabel", lab )
desc:SetPos( 9, 47 )
desc:SetSize( lab:GetWide() - 20, lab:GetTall() )
desc:SetTextColor( Color( 0, 0, 0 ) )
desc:SetWrap( true )
desc:SetFont( "VoteFont" )
afj = vgui.Create( "DButton", lab )
afj:SetSize( 272, 50 )
afj:SetPos( 9, lab:GetTall() - 59 )
afj:SetText( "Купить" )
afj:SetFont( "boxmainf" )
afj:SetTextColor( Color( 255, 255, 255, 255 ) )
afj.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
afj.OnCursorEntered = function( self ) self.hover = true end
afj.OnCursorExited = function( self ) self.hover = false end
afj.DoClick = function()
if ent.max then
RunConsoleCommand( "DarkRP", ent.cmd )
elseif ent.noship == false then
RunConsoleCommand( "say", "/buyshipment "..ent.name )
elseif ent.noship then
RunConsoleCommand( "say", "/buy "..ent.name )
end
end
if ent.noship == false and ent.seperate then
desc:SetText( "Цена за ящик: "..ent.price.." р. \nЦена за штуку: "..ent.pricesep.." р." )
afj:SetText( "Купить ящик" )
afj2 = vgui.Create( "DButton", lab )
afj2:SetSize( 272, 50 )
afj2:SetPos( 9, lab:GetTall() - 113 )
afj2:SetText( "Купить один" )
afj2:SetFont( "boxmainf" )
afj2:SetTextColor( Color( 255, 255, 255, 255 ) )
afj2.Paint = function( self, w, h ) if self.hover then draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 )) else draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 )) end end
afj2.OnCursorEntered = function( self ) self.hover = true end
afj2.OnCursorExited = function( self ) self.hover = false end
afj2.DoClick = function()
RunConsoleCommand( "say", "/buy "..ent.name )
end
else
desc:SetText( "Цена за штуку: "..ent.price.." р." )
afj:SetText( "Купить" )
end
desc:SetAutoStretchVertical( true )
main2:AddItem( lab )
end
local function AddJobPanel( v, k )
if v.allowed and !table.HasValue(v.allowed, LocalPlayer():Team()) then
return
end
local jobc = vgui.Create( "DFrame", main )
jobc:SetSize( main:GetWide(), 60 )
jobc:SetTitle( "" )
jobc:ShowCloseButton( false )
jobc:SetDraggable( false )
jobc.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h + 20, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 255, 255, 255, 255 ) )
end
local icon = vgui.Create("SpawnIcon", jobc)
icon:SetPos( 9, 0 )
local IconModel = v.model
if type(v.model) == "table" then
IconModel = v.model[math.random(#v.model)]
end
icon:SetModel(IconModel)
icon:SetSize( 60 , 60 )
local lab = vgui.Create( "DLabel", jobc )
lab:SetPos( 78, 20 )
lab:SetText( v.name )
lab:SetFont( "jobtitlef" )
lab:SetTextColor( Color( 0, 0, 0, 255 ) )
lab:SizeToContents()
local sel = vgui.Create( "DButton", jobc )
sel:SetSize( jobc:GetWide(), jobc:GetTall() )
sel:SetPos( 0, 0 )
sel:SetText( "" )
sel.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 0 ) ) end
sel.DoClick = function( self ) main2:Clear() AddJobInfo( v ) end
AddJobInfo( v )
main:AddItem( jobc )
end
local adve4 = vgui.Create("DTextEntry", ebg)
adve4:SetText("")
adve4:SetFont("boxmainf")
adve4:SetPos( 9, 9 )
adve4:SetSize( 257, 36)
adve4.Paint = function( self, w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color( 200, 200, 200))
draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 255, 255, 255))
if self:GetValue() == "" then
draw.SimpleText( "Введите фильтр...", "boxmainf", 4, 11, Color( 0, 0, 0, 90 ), TEXT_ALIGN_LEFT )end
self:DrawTextEntryText(Color(30, 30, 30), Color(149, 240, 193), Color(0, 0, 0))
end
adve4.OnEnter = function() main:Clear() for k, v in pairs( allents ) do if string.find(string.lower(v.name), string.lower(adve4:GetValue()), 1, true) then
if !SSK.ShowDonatorEntitiesToAll then local hasCheck if v.customCheck then hasCheck = true end if hasCheck and v.customCheck( LocalPlayer() ) then AddJobPanel( v, k ) elseif !hasCheck then AddJobPanel( v, k ) end else AddJobPanel( v, k ) end end end end
local advb4 = vgui.Create( "DButton", ebg )
advb4:SetSize( 34, 36 )
advb4:SetPos( 266, 9 )
advb4:SetText( "" )
advb4.Paint = function( self, w, h ) if self.hover then
draw.RoundedBox( 4, 1, 0, w-1, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 36, 38, 50 ))
surface.SetMaterial(Material("gui/html/refresh.vtf"))
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(1,2,32,32)
else draw.RoundedBox( 4, 1, 0, w-1, h, Color( 200, 200, 200)) draw.RoundedBox( 0, 1, 1, w-2, h-2, Color( 47, 150, 217 ))
surface.SetMaterial(Material("gui/html/refresh.vtf"))
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(1,2,32,32)
end end
advb4.DoClick = function() main:Clear()
for k, v in pairs( allents ) do
if string.find(string.lower(v.name), string.lower(adve4:GetValue()), 1, true) then
if !SSK.ShowDonatorEntitiesToAll then local hasCheck if v.customCheck then hasCheck = true end
if hasCheck and v.customCheck( LocalPlayer() ) then AddJobPanel( v, k ) elseif !hasCheck then AddJobPanel( v, k ) end
else AddJobPanel( v, k ) end end end
end
advb4.OnCursorEntered = function( self ) self.hover = true end
advb4.OnCursorExited = function( self ) self.hover = false end
shipments = fn.Filter(fn.Curry(fn.GetValue, 2)("seperate"), CustomShipments)
ships = fn.Filter(fn.Compose{fn.Not, fn.Curry(fn.GetValue, 2)("noship")}, CustomShipments)
allents = {}
for k, v in pairs( DarkRPEntities ) do table.insert( allents, v ) end
for k, v in pairs( CustomShipments ) do table.insert( allents, v ) end
for k, v in pairs( allents ) do
if !SSK.ShowDonatorEntitiesToAll then local hasCheck if v.customCheck then hasCheck = true end
if hasCheck and v.customCheck( LocalPlayer() ) then AddJobPanel( v, k ) elseif !hasCheck then AddJobPanel( v, k ) end
else AddJobPanel( v, k ) end end
/*local function DrawEntButton( ent, offset )
if ent.allowed and !table.HasValue(ent.allowed, LocalPlayer():Team()) then
return
end
local jobc = vgui.Create( "DFrame" )
jobc:SetSize( main:GetWide(), 54 )
jobc:SetTitle( "" )
jobc:ShowCloseButton( false )
jobc:SetDraggable( false )
jobc.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h + 20, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
local x2, y2 = main:LocalToScreen( 0, 0 )
local w2, h2 = main:GetSize()
render.SetScissorRect( x2, y2, x2 + w2, y2 + h2, true )
render.SetScissorRect( 0, 0, 0, 0, false )
end
local fx
local sx
if ent.max then
fx = ""
elseif ent.noship == false then
fx = ""
elseif ent.noship then
fx = ""
else
fx = ""
end
local lab = vgui.Create( "DLabel", jobc )
lab:SetPos( 75, 6 )
lab:SetText( fx..ent.name )
lab:SetFont( "jobtitlef" )
lab:SetTextColor( Color( 0, 0, 0, 255 ) )
lab:SizeToContents()
local desc = vgui.Create( "DLabel", jobc )
desc:SetPos( 75, 30 )
desc:SetSize( jobc:GetWide() - 200, jobc:GetTall() )
desc:SetTextColor( Color( 0, 0, 0, 200 ) )
desc:SetWrap( true )
desc:SetFont( "entmainf" )
if ent.noship == false and ent.seperate then
desc:SetText( "Ящик: "..ent.price.." р, Поодиночке: "..ent.pricesep.." р." )
else
desc:SetText( "Цена: "..ent.price.." р." )
end
desc:SetAutoStretchVertical( true )
local icon = vgui.Create("SpawnIcon", jobc)
icon:SetPos( 15, 0 )
local IconModel = ent.model
if type(ent.model) == "table" then
IconModel = ent.model[math.random(#ent.model)]
end
icon:SetModel(IconModel)
icon:SetSize( 50, 50 )
local afj = vgui.Create( "DButton", jobc )
afj:SetSize( 90, 30 )
if ent.noship == false and ent.seperate then
afj:SetPos( jobc:GetWide() - 142, 17 )
afj:SetText( "Купить ящик" )
else
afj:SetPos( jobc:GetWide() - 142, 17 )
afj:SetText( "Купить" )
end
afj:SetFont( "buyitemfont" )
afj:SetTextColor( Color( 255, 255, 255, 255 ) )
afj.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 8, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 8, 1, 1, w - 2, h - 2, gcol )
end
afj.DoClick = function()
if ent.max then
RunConsoleCommand( "DarkRP", ent.cmd )
elseif ent.noship == false then
RunConsoleCommand( "say", "/buyshipment "..ent.name )
elseif ent.noship then
RunConsoleCommand( "say", "/buy "..ent.name )
elseif table.HasValue( GAMEMODE.AmmoTypes, ent ) then
RunConsoleCommand( "say", "/buyammo "..ent.ammoType )
end
end
afj.OnCursorEntered = function( self )
self.hover = true
end
afj.OnCursorExited = function( self )
self.hover = false
end
if ent.noship == false and ent.seperate then
local single = vgui.Create( "DButton", jobc )
single:SetSize( 90, 30 )
single:SetPos( jobc:GetWide() - 237, 17 )
single:SetText( "Купить один" )
single:SetFont( "buyitemfont" )
single:SetTextColor( Color( 255, 255, 255, 255 ) )
single.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 8, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 8, 1, 1, w - 2, h - 2, gcol )
end
single.DoClick = function()
RunConsoleCommand( "say", "/buy "..ent.name )
end
single.OnCursorEntered = function( self )
self.hover = true
end
single.OnCursorExited = function( self )
self.hover = false
end
end
if table.HasValue( GAMEMODE.AmmoTypes, ent ) then
ammolist:AddItem( jobc )
elseif table.HasValue( CustomShipments, ent ) then
weplist:AddItem( jobc )
elseif table.HasValue( CustomVehicles, ent ) then
vehlist:AddItem( jobc )
else
otlist:AddItem( jobc )
end
end
local shipments = fn.Filter(fn.Curry(fn.GetValue, 2)("seperate"), CustomShipments)
local ships = fn.Filter(fn.Compose{fn.Not, fn.Curry(fn.GetValue, 2)("noship")}, CustomShipments)
local allents = {}
for k, v in pairs( DarkRPEntities ) do
table.insert( allents, v )
end
for k, v in pairs( CustomShipments ) do
table.insert( allents, v )
end
for k, v in pairs( GAMEMODE.AmmoTypes ) do
table.insert( allents, v )
end
for k, v in pairs( CustomVehicles ) do
table.insert( allents, v )
end
for k, v in pairs( allents ) do
if !SSK.ShowDonatorEntitiesToAll then
local hasCheck
if v.customCheck then
hasCheck = true
end
if hasCheck and v.customCheck( LocalPlayer() ) then
DrawEntButton( v, k )
elseif !hasCheck then
DrawEntButton( v, k )
end
else
DrawEntButton( v, k )
end
end
entOpen = true
local wepHas = HasStuff( weplist )
local ammoHas = HasStuff( ammolist )
local otHas = HasStuff( otlist )
wepan:SetExpanded( wepHas )
ammopan:SetExpanded( ammoHas )
otpan:SetExpanded( otHas )
*/
end
local mclick = false
local jclick = false
local eclick = false
local fclick = false
local dclick = false
local mhover = false
local jhover = false
local ehover = false
local fhover = false
local dhover = false
local mp = vgui.Create( "Panel", cf )
mp:SetSize( 150, 50 )
mp:SetPos( 0, 0 )
mp.Paint = function( self, w, h )
if mhover then
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 47, 150, 217 ), true, false, false, false )
draw.SimpleText( "Главная", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
elseif mclick then
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 255, 255, 255), true, false, false, false )
draw.SimpleText( "Главная", "sidefont", 75, 15, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
else
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 36, 38, 50 ), true, false, false, false )
draw.SimpleText( "Главная", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
end
end
local mb = vgui.Create( "DButton", cf )
mb:SetSize( 150, 50 )
mb:SetPos( 0, 0 )
mb:SetText( "" )
mb.Paint = function() end
mb.DoClick = function() mclick = true jclick = false eclick = false fclick = false if jobOpen then jbg:Close() jobOpen = false end if entOpen then ebg:Close() entOpen = false end if !cmdOpen then OpenCmds() end cmdOpen = true end
mb.OnCursorEntered = function() mhover = true end
mb.OnCursorExited = function() mhover = false end
local jp = vgui.Create( "Panel", cf )
jp:SetSize( 150, 50 )
jp:SetPos( 150, 0 )
jp.Paint = function( self, w, h )
if jhover then
draw.RoundedBox( 0, 0, 0, w, h, Color( 47, 150, 217 ))
draw.SimpleText( "Профессии", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
elseif jclick then
draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255))
draw.SimpleText( "Профессии", "sidefont", 75, 15, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
else
draw.RoundedBox( 0, 0, 0, w, h, Color( 36, 38, 50 ))
draw.SimpleText( "Профессии", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
end
end
local jb = vgui.Create( "DButton", cf )
jb:SetSize( 150, 50 )
jb:SetPos( 150, 0 )
jb:SetText( "" )
jb.Paint = function() end
jb.DoClick = function() jclick = true mclick = false eclick = false fclick = false if cmdOpen then mbg:Close() cmdOpen = false end if !jobOpen then OpenJobs() end if entOpen then ebg:Close() entOpen = false end jobOpen = true end
jb.OnCursorEntered = function() jhover = true end
jb.OnCursorExited = function() jhover = false end
local ep = vgui.Create( "Panel", cf )
ep:SetSize( 150, 50 )
ep:SetPos( 300, 0 )
ep.Paint = function( self, w, h )
if ehover then
draw.RoundedBox( 0, 0, 0, w, h, Color( 47, 150, 217 ))
draw.SimpleText( "Магазин", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
elseif eclick then
draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 255, 255))
draw.SimpleText( "Магазин", "sidefont", 75, 15, Color( 47, 150, 217 ), TEXT_ALIGN_CENTER )
else
draw.RoundedBox( 0, 0, 0, w, h, Color( 36, 38, 50 ))
draw.SimpleText( "Магазин", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
end
end
local eb = vgui.Create( "DButton", cf )
eb:SetSize( 150, 50 )
eb:SetPos( 300, 0 )
eb:SetText( "" )
eb.Paint = function() end
eb.DoClick = function() jclick = false mclick = false eclick = true fclick = false if cmdOpen then mbg:Close() cmdOpen = false end if jobOpen then jbg:Close() jobOpen = false end if !entOpen then OpenEnts() end entOpen = true end
eb.OnCursorEntered = function() ehover = true end
eb.OnCursorExited = function() ehover = false end
local cl = vgui.Create( "DButton", cf )
cl:SetSize( 150, 50 )
cl:SetPos( cf:GetWide() - 150, 0 )
cl:SetText( "" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
if self.hover then
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 178, 38, 50 ), false, true, false, false )
draw.SimpleText( "Закрыть", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
else
draw.RoundedBoxEx( 8, 0, 0, w, h, Color( 78, 38, 50 ), false, true, false, false )
draw.SimpleText( "Закрыть", "sidefont", 75, 15, Color( 255, 255, 255), TEXT_ALIGN_CENTER )
end
end
cl.DoClick = function() bg:Close() isOpen = false textOpen = false end
cl.OnCursorEntered = function( self ) self.hover = true end cl.OnCursorExited = function( self ) self.hover = false end
mclick = true
jclick = false
eclick = false
dclick = false
fclick = false
cmdOpen = true
entOpen = false
jobOpen = false
ammoOpen = false
if jobOpen then
jbg:Close()
jobOpen = false
end
OpenCmds()
end
GM.ShowSpare2 = ChangeJobVGUI
surface.CreateFont( "DoorButtonFont", {
font = "Bebas Neue",
size = 20,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
local KeyFrameVisible = false
local function KeysMenu(um)
local Vehicle = LocalPlayer():GetEyeTrace().Entity
Vehicle = IsValid(Vehicle) and Vehicle:IsVehicle()
if KeyFrameVisible then return end
local trace = LocalPlayer():GetEyeTrace()
local Frame = vgui.Create("DFrame")
KeyFrameVisible = true
Frame:SetSize(200, 230)
Frame:Center()
Frame:SetVisible(true)
Frame:ShowCloseButton( false )
Frame:MakePopup()
Frame.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color( 224, 224, 224, 255 ) )
draw.RoundedBox( 0, 1, 1, w - 2, h - 2, Color( 250, 250, 250, 255 ) )
draw.RoundedBox( 0, 0, 0, w, 36, Color( 23, 25, 37 ) )
draw.SimpleText( "Опции двери", "VoteFont", 10, 7, Color( 255, 255, 255, 255 ) )
end
function Frame:Think()
local ent = LocalPlayer():GetEyeTrace().Entity
if not IsValid(ent) or (not ent:IsDoor() and not ent:IsVehicle()) or ent:GetPos():Distance(LocalPlayer():GetPos()) > 200 then
self:Close()
end
if (!self.Dragging) then return end
local x = gui.MouseX() - self.Dragging[1]
local y = gui.MouseY() - self.Dragging[2]
x = math.Clamp( x, 0, ScrW() - self:GetWide() )
y = math.Clamp( y, 0, ScrH() - self:GetTall() )
self:SetPos( x, y )
end
local Entiteh = "door"
if Vehicle then
Entiteh = "vehicle"
end
Frame:SetTitle("")
function Frame:Close()
KeyFrameVisible = false
self:SetVisible( false )
self:Remove()
end
local cl = vgui.Create( "DButton", Frame )
cl:SetSize( 50, 20 )
cl:SetPos( Frame:GetWide() - 60, 0 )
cl:SetText( "X" )
cl:SetFont( "fontclose" )
cl:SetTextColor( Color( 255, 255, 255, 255 ) )
cl.Paint = function( self, w, h )
local kcol
if self.hover then
kcol = Color( 255, 0, 0, 255 )
else
kcol = Color( 100, 0, 0 )
end
draw.RoundedBoxEx( 0, 0, 0, w, h, kcol, false, false, true, true )
end
cl.DoClick = function()
Frame:Close()
end
cl.OnCursorEntered = function( self )
self.hover = true
end
cl.OnCursorExited = function( self )
self.hover = false
end
if not IsValid(trace.Entity) then Frame:Close() return end
if trace.Entity:OwnedBy(LocalPlayer()) then
if not trace.Entity.DoorData then return end -- Don't open the menu when the door settings are not loaded yet
local Owndoor = vgui.Create("DButton", Frame)
Owndoor:SetPos(10, 30 + 14)
Owndoor:SetSize(182, 40)
Owndoor:SetText("Продать")
Owndoor:SetFont( "DoorButtonFont" )
Owndoor:SetTextColor(Color(255, 255, 255, 255))
Owndoor.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
Owndoor.DoClick = function() RunConsoleCommand("darkrp", "/toggleown") Frame:Close() end
Owndoor.OnCursorEntered = function( self ) self.hover = true end
Owndoor.OnCursorExited = function( self ) self.hover = false end
local AddOwner = vgui.Create("DButton", Frame)
AddOwner:SetPos(10, 75+ 14)
AddOwner:SetSize(182, 40)
AddOwner:SetText("Добавить владельца")
AddOwner:SetFont( "DoorButtonFont" )
AddOwner:SetTextColor(Color(255, 255, 255, 255))
AddOwner.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
AddOwner.DoClick = function()
local menu = DermaMenu()
menu.found = false
for k,v in pairs(player.GetAll()) do
if not trace.Entity:OwnedBy(v) and not trace.Entity:AllowedToOwn(v) then
menu.found = true
menu:AddOption(v:Nick(), function() RunConsoleCommand("darkrp", "/ao", v:SteamID()) end)
end
end
if not menu.found then
menu:AddOption("None available", function() end)
end
menu:Open()
end
AddOwner.OnCursorEntered = function( self ) self.hover = true end
AddOwner.OnCursorExited = function( self ) self.hover = false end
local RemoveOwner = vgui.Create("DButton", Frame)
RemoveOwner:SetPos(10, 120+ 14)
RemoveOwner:SetSize(182, 40)
RemoveOwner:SetText("Удалить владельца")
RemoveOwner:SetFont( "DoorButtonFont" )
RemoveOwner:SetTextColor(Color(255, 255, 255, 255))
RemoveOwner.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
RemoveOwner.DoClick = function()
local menu = DermaMenu()
for k,v in pairs(player.GetAll()) do
if (trace.Entity:OwnedBy(v) and not trace.Entity:IsMasterOwner(v)) or trace.Entity:AllowedToOwn(v) then
menu.found = true
menu:AddOption(v:Nick(), function() RunConsoleCommand("darkrp", "/ro", v:SteamID()) end)
end
end
if not menu.found then
menu:AddOption("None available", function() end)
end
menu:Open()
end
RemoveOwner.OnCursorEntered = function( self ) self.hover = true end
RemoveOwner.OnCursorExited = function( self ) self.hover = false end
local DoorTitle = vgui.Create("DButton", Frame)
DoorTitle:SetPos(10, 165+ 14)
DoorTitle:SetSize(182, 40)
DoorTitle:SetFont( "DoorButtonFont" )
DoorTitle:SetTextColor(Color(255, 255, 255, 255))
DoorTitle:SetText("Установить название")
if not trace.Entity:IsMasterOwner(LocalPlayer()) then
RemoveOwner.m_bDisabled = true
end
DoorTitle.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
DoorTitle.DoClick = function()
Derma_StringRequest("Set door title", "Set the title of the "..Entiteh.." you're looking at", "", function(text)
RunConsoleCommand("darkrp", "/title", text)
if ValidPanel(Frame) then
Frame:Close()
end
end,
function() end, "OK!", "CANCEL!")
end
DoorTitle.OnCursorEntered = function( self ) self.hover = true end
DoorTitle.OnCursorExited = function( self ) self.hover = false end
if (FAdmin and FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "rp_doorManipulation") or LocalPlayer():IsAdmin()) and not Vehicle then
Frame:SetSize(200, Frame:GetTall() + 110)
local SetCopsOnly = vgui.Create("DButton", Frame)
SetCopsOnly:SetPos(10, 210+14)
SetCopsOnly:SetSize(180, 40)
SetCopsOnly:SetText("Настроить группы")
SetCopsOnly.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
SetCopsOnly.OnCursorEntered = function( self ) self.hover = true end
SetCopsOnly.OnCursorExited = function( self ) self.hover = false end
SetCopsOnly.DoClick = function()
local menu = DermaMenu()
local groups = menu:AddSubMenu("Door Groups")
local teams = menu:AddSubMenu("Jobs")
local add = teams:AddSubMenu("Add")
local remove = teams:AddSubMenu("Remove")
menu:AddOption("None", function() RunConsoleCommand("darkrp", "/togglegroupownable") Frame:Close() end)
for k,v in pairs(RPExtraTeamDoors) do
groups:AddOption(k, function() RunConsoleCommand("darkrp", "/togglegroupownable", k) Frame:Close() end)
end
if not trace.Entity.DoorData then return end
for k,v in pairs(RPExtraTeams) do
if not trace.Entity.DoorData.TeamOwn or not trace.Entity.DoorData.TeamOwn[k] then
add:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
else
remove:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
end
end
menu:Open()
end
end
elseif not trace.Entity:OwnedBy(LocalPlayer()) and trace.Entity:IsOwnable() and not trace.Entity:IsOwned() and not trace.Entity.DoorData.NonOwnable then
if not trace.Entity.DoorData.GroupOwn then
Frame:SetSize(200, 140)
local Owndoor = vgui.Create("DButton", Frame)
Owndoor:SetPos(10, 30+14)
Owndoor:SetSize(180, 40)
Owndoor:SetText("Купить")
Owndoor.Paint = function( self, w, h )
local gcol
if self.hover then
gcol = Color( 36, 190, 255 )
else
gcol = Color( 26, 160, 212 )
end
draw.RoundedBox( 6, 0, 0, w, h, Color( 22, 131, 173 ) )
draw.RoundedBox( 6, 1, 1, w - 2, h - 2, gcol )
end
Owndoor.DoClick = function() RunConsoleCommand("darkrp", "/toggleown") Frame:Close() end
end
if (FAdmin and FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "rp_doorManipulation") or LocalPlayer():IsAdmin()) then
if trace.Entity.DoorData.GroupOwn then
Frame:SetSize(200, 250)
else
Frame:SetSize(200, 360)
end
local DisableOwnage = vgui.Create("DButton", Frame)
DisableOwnage:SetPos(10, Frame:GetTall() - 220)
DisableOwnage:SetSize(180, 100)
DisableOwnage:SetText("Disallow ownership")
DisableOwnage.DoClick = function() Frame:Close() RunConsoleCommand("darkrp", "/toggleownable") end
local SetCopsOnly = vgui.Create("DButton", Frame)
SetCopsOnly:SetPos(10, Frame:GetTall() - 110)
SetCopsOnly:SetSize(180, 100)
SetCopsOnly:SetText("Edit Door Group")
SetCopsOnly.DoClick = function()
local menu = DermaMenu()
local groups = menu:AddSubMenu("Door Groups")
local teams = menu:AddSubMenu("Jobs")
local add = teams:AddSubMenu("Add")
local remove = teams:AddSubMenu("Remove")
menu:AddOption("None", function() RunConsoleCommand("darkrp", "/togglegroupownable") Frame:Close() end)
for k,v in pairs(RPExtraTeamDoors) do
groups:AddOption(k, function() RunConsoleCommand("darkrp", "/togglegroupownable", k) Frame:Close() end)
end
if not trace.Entity.DoorData then return end
for k,v in pairs(RPExtraTeams) do
if not trace.Entity.DoorData.TeamOwn or not trace.Entity.DoorData.TeamOwn[k] then
add:AddOption(v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) if Frame.Close then Frame:Close() end end)
else
remove:AddOption(v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end)
end
end
menu:Open()
end
elseif not trace.Entity.DoorData.GroupOwn then
RunConsoleCommand("darkrp", "/toggleown")
Frame:Close()
KeyFrameVisible = true
timer.Simple(0.3, function() KeyFrameVisible = false end)
end
elseif not trace.Entity:OwnedBy(LocalPlayer()) and trace.Entity:AllowedToOwn(LocalPlayer()) then
Frame:SetSize(200, 140)
local Owndoor = vgui.Create("DButton", Frame)
Owndoor:SetPos(10, 30)
Owndoor:SetSize(180, 100)
Owndoor:SetText("Co-own " .. Entiteh)
Owndoor.DoClick = function() RunConsoleCommand("darkrp", "/toggleown") Frame:Close() end
if (FAdmin and FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "rp_doorManipulation") or LocalPlayer():IsAdmin()) then
Frame:SetSize(200, Frame:GetTall() + 110)
local SetCopsOnly = vgui.Create("DButton", Frame)
SetCopsOnly:SetPos(10, Frame:GetTall() - 110)
SetCopsOnly:SetSize(180, 100)
SetCopsOnly:SetText("Edit Door Group")
SetCopsOnly.DoClick = function()
local menu = DermaMenu()
local groups = menu:AddSubMenu("Door Groups")
local teams = menu:AddSubMenu("Jobs")
local add = teams:AddSubMenu("Add")
local remove = teams:AddSubMenu("Remove")
menu:AddOption("None", function() RunConsoleCommand("darkrp", "/togglegroupownable") Frame:Close() end)
for k,v in pairs(RPExtraTeamDoors) do
groups:AddOption(k, function() RunConsoleCommand("darkrp", "/togglegroupownable", k) Frame:Close() end)
end
if not trace.Entity.DoorData then return end
for k,v in pairs(RPExtraTeams) do
if not trace.Entity.DoorData.TeamOwn or not trace.Entity.DoorData.TeamOwn[k] then
add:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
else
remove:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
end
end
menu:Open()
end
else
RunConsoleCommand("darkrp", "/toggleown")
Frame:Close()
KeyFrameVisible = true
timer.Simple(0.3, function() KeyFrameVisible = false end)
end
elseif (FAdmin and FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "rp_doorManipulation") or LocalPlayer():IsAdmin()) and trace.Entity.DoorData.NonOwnable then
Frame:SetSize(200, 250)
local EnableOwnage = vgui.Create("DButton", Frame)
EnableOwnage:SetPos(10, 30)
EnableOwnage:SetSize(180, 100)
EnableOwnage:SetText("Allow ownership")
EnableOwnage.DoClick = function() Frame:Close() RunConsoleCommand("darkrp", "/toggleownable") end
local DoorTitle = vgui.Create("DButton", Frame)
DoorTitle:SetPos(10, Frame:GetTall() - 110)
DoorTitle:SetSize(180, 100)
DoorTitle:SetText("Set "..Entiteh.." title")
DoorTitle.DoClick = function()
Derma_StringRequest("Set door title", "Set the title of the "..Entiteh.." you're looking at", "", function(text) RunConsoleCommand("darkrp", "/title", text) Frame:Close() end, function() end, "OK!", "CANCEL!")
end
elseif (FAdmin and FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "rp_doorManipulation") or LocalPlayer():IsAdmin()) and not trace.Entity:OwnedBy(LocalPlayer()) and trace.Entity:IsOwned() and not trace.Entity:AllowedToOwn(LocalPlayer()) then
Frame:SetSize(200, 250)
local DisableOwnage = vgui.Create("DButton", Frame)
DisableOwnage:SetPos(10, 30)
DisableOwnage:SetSize(180, 100)
DisableOwnage:SetText("Disallow ownership")
DisableOwnage.DoClick = function() Frame:Close() RunConsoleCommand("darkrp", "/toggleownable") end
local SetCopsOnly = vgui.Create("DButton", Frame)
SetCopsOnly:SetPos(10, Frame:GetTall() - 110)
SetCopsOnly:SetSize(180, 100)
SetCopsOnly:SetText("Edit Door Group")
SetCopsOnly.DoClick = function()
local menu = DermaMenu()
local groups = menu:AddSubMenu("Door Groups")
local teams = menu:AddSubMenu("Jobs")
local add = teams:AddSubMenu("Add")
local remove = teams:AddSubMenu("Remove")
if not trace.Entity.DoorData then return end
menu:AddOption("None", function() RunConsoleCommand("darkrp", "/togglegroupownable") Frame:Close() end)
for k,v in pairs(RPExtraTeamDoors) do
groups:AddOption(k, function() RunConsoleCommand("darkrp", "/togglegroupownable", k) Frame:Close() end)
end
for k,v in pairs(RPExtraTeams) do
if not trace.Entity.DoorData.TeamOwn or not trace.Entity.DoorData.TeamOwn[k] then
add:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
else
remove:AddOption( v.name, function() RunConsoleCommand("darkrp", "/toggleteamownable", k) Frame:Close() end )
end
end
menu:Open()
end
else
Frame:Close()
end
end
GM.ShowTeam = KeysMenu
usermessage.Hook("KeysMenu", KeysMenu)
@ggg3q
Copy link

ggg3q commented Dec 27, 2018

er

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment