Это конфиг
– “addons\scoreboard\lua\autorun\client\main.lua”
– Retrieved by GitHub - lewisclark/glua-steal: Retrieves client-sided Lua files from Garry's Mod game servers
local Derma_StringRequest, draw_RoundedBox, draw_RoundedBoxEx, draw_SimpleText, game_GetIPAddress, gui_EnableScreenClicker, gui_OpenURL, hook_Add, math_ceil, math_Clamp, math_floor, player_GetAll, ScreenScale, surface_CreateFont, FindMetaTable, math_Round, surface_DrawTexturedRect, surface_SetDrawColor, surface_SetMaterial, table_insert, team_GetColor, team_GetName, Format, Material, table_Copy, table_sort, timer_Create, vgui_Create, pairs, Color, LocalPlayer, CurTime, ColorAlpha, HSVToColor, IsValid, SetClipboardText, RunConsoleCommand, ipairs, timer_Destroy, timer_Simple = Derma_StringRequest, draw.RoundedBox, draw.RoundedBoxEx, draw.SimpleText, game.GetIPAddress, gui.EnableScreenClicker, gui.OpenURL, hook.Add, math.ceil, math.Clamp, math.floor, player.GetAll, ScreenScale, surface.CreateFont, FindMetaTable, math.Round, surface.DrawTexturedRect, surface.SetDrawColor, surface.SetMaterial, table.insert, team.GetColor, team.GetName, Format, Material, table.Copy, table.sort, timer.Create, vgui.Create, pairs, Color, LocalPlayer, CurTime, ColorAlpha, HSVToColor, IsValid, SetClipboardText, RunConsoleCommand, ipairs, timer.Destroy, timer.Simple
local x, y = ScrW(), ScrH()
surface_CreateFont(‘ScrFancyFontBoldBig’, {
font = ‘PT Root UI Bold’,
size = ScreenScale(15),
antialias = true,
extended = true
})
surface_CreateFont(‘HUDFancyFont’, {
font = ‘PT Root UI Bold’,
size = ScreenScale(6),
antialias = true,
extended = true
})
surface_CreateFont(‘ScrFancyButtonBold’, {
font = ‘PT Root UI Bold’,
size = ScreenScale(8),
antialias = true,
extended = true
})
surface_CreateFont(‘ScrFancyButton’, {
font = ‘PT Root UI Medium’,
size = ScreenScale(8),
antialias = true,
extended = true
})
surface_CreateFont(‘ScrFancyButtonSmall’, {
font = ‘PT Root UI Medium’,
size = ScreenScale(4),
antialias = true,
extended = true
})
surface_CreateFont(‘ScrFancyLine’, {
font = ‘PT Root UI Medium’,
size = ScreenScale(6),
antialias = true,
extended = true
})
local pMeta = FindMetaTable(‘Player’)
function pMeta:JobName()
local teamname = team_GetName(self:Team())
return teamname
end
function pMeta:JobColor()
local teamcolor = team_GetColor(self:Team())
return teamcolor
end
local function timeToStr(time)
local tmp = time / 60 / 60
if tmp < 1 then
tmp = math_Round(tmp * 60)
return tmp .. ' м'
elseif tmp < 10 then
local minutes = tmp - math_floor(tmp)
minutes = (math_Round(minutes * 60))
return math_floor(tmp) .. ':' .. Format('%.2d', minutes) .. ' ч'
else
tmp = math_Round(tmp)
return tmp .. ' ч'
end
end
local ipsid = {
[‘212.22.93.215:27015’] = 1,
[‘212.22.93.171:27015’] = 2
}
local nowipid = ipsid[game_GetIPAddress()]
local idserver = 1
if nowipid then
idserver = nowipid
end
local discordmat = Material(‘gambitrp/scoreboard/discord.png’)
local vkmat = Material(‘gambitrp/scoreboard/vk.png’)
local pingmat = Material(‘gambitrp/scoreboard/ping.png’)
local jobmat = Material(‘gambitrp/scoreboard/job.png’)
local butgradmat = Material(‘gambitrp/f4/but_grad.png’)
function TestBoard()
TestBoard = vgui_Create(‘ui_frame’)
TestBoard:SetSize(x * 0.475, y * 0.755)
gui_EnableScreenClicker(true)
TestBoard:Center()
TestBoard:MakePopup()
TestBoard:SetKeyboardInputEnabled(false)
TestBoard:ShowCloseButton(false)
TestBoard:SetTitle(‘’)
TestBoard.Close = function()
gui_EnableScreenClicker(false)
TestBoard:MoveTo(x, y / 2 - TestBoard:GetTall() / 2, 0.2, 0, 1)
timer_Create('RemoveWindow', .2, 1, function()
TestBoard:Remove()
end)
end
local players = 0
local admins = 0
for k, v in pairs(player_GetAll()) do
if v:GetUserGroup() ~= 'user' and v:GetUserGroup() ~= 'vip' then
admins = admins + 1
end
players = players + 1
end
local textspacex, textspacey = x * 0.01771, y * 0.015
local icondiscord, iconvk = x * 0.012, x * 0.0136
TestBoard.Paint = function(self, w, h)
draw_RoundedBox(8, 0, 0, w, h, Color(45, 45, 45, 250))
draw_SimpleText('GAMBITRP', 'ScrFancyFontBoldBig', w / 2, y * 0.014, color_white, 1)
draw_SimpleText('С Е Р В Е Р # ' .. idserver, 'ScrFancyButtonBold', w / 2, y * 0.0556, Color(255, 216, 0), 1)
draw_SimpleText('Наш Discord', 'ScrFancyButtonBold', x * 0.062, y * 0.0232, Color(83, 109, 254))
draw_SimpleText('gambitrp.ru/discord', 'ScrFancyButtonBold', x * 0.062, y * 0.0464, color_white)
surface_SetMaterial(discordmat)
surface_SetDrawColor(color_white.r, color_white.g, color_white.b)
surface_DrawTexturedRect(x * 0.042, y * 0.0464 - icondiscord, icondiscord, icondiscord)
draw_SimpleText('Мы ВКонтакте', 'ScrFancyButtonBold', x * 0.3693, y * 0.0232, Color(39, 135, 245))
draw_SimpleText('gambitrp.ru/vk', 'ScrFancyButtonBold', x * 0.3693, y * 0.0464, color_white)
surface_SetMaterial(vkmat)
surface_SetDrawColor(color_white.r, color_white.g, color_white.b)
surface_DrawTexturedRect(x * 0.3503, y * 0.0464 - iconvk, iconvk, iconvk)
local admintext = draw_SimpleText('Администрации онлайн: ', 'HUDFancyFont', textspacex, h - textspacey, color_white, 0, 4) -- тут было Color(141, 141, 141)
draw_SimpleText(admins, 'HUDFancyFont', textspacex + admintext, h - textspacey, Color(255, 216, 0), 0, 4)
surface.SetFont('HUDFancyFont')
local playerslistw = surface.GetTextSize(players)
local playerstext = draw_SimpleText('Игроков на сервере: ', 'HUDFancyFont', w / 2 - playerslistw / 2, h - textspacey, color_white, 1, 4)
draw_SimpleText(players, 'HUDFancyFont', w / 2 + playerstext / 2, h - textspacey, Color(255, 216, 0), 1, 4)
local onlinetext = draw_SimpleText(timeToStr(LocalPlayer():GetNW2Int('playtime') or 0) .. '.', 'HUDFancyFont', w - textspacex, h - textspacey, Color(255, 216, 0), 2, 4)
draw_SimpleText('Ваш онлайн: ', 'HUDFancyFont', w - textspacex - onlinetext, h - textspacey, color_white, 2, 4)
draw_RoundedBox(0, 0, y * 0.09, w, 1, Color(54, 54, 54))
draw_SimpleText('Ник', 'ScrFancyButton', w / 15.5, y * 0.1047, Color(124, 124, 124), 1)
draw_SimpleText('Профессия', 'ScrFancyButton', w / 2.75, y * 0.1047, Color(124, 124, 124), 1)
draw_SimpleText('Клан', 'ScrFancyButton', w / 1.6, y * 0.1047, Color(124, 124, 124), 1)
draw_SimpleText('Пинг', 'ScrFancyButton', w / 1.15, y * 0.1047, Color(124, 124, 124), 1)
draw_RoundedBox(0, 0, y * 0.709 + 1, w, 1, Color(54, 54, 54))
end
local discordbut = vgui_Create('DButton', TestBoard)
discordbut:SetSize(x * 0.13, y * 0.0475)
discordbut:SetPos(x * 0.042, y * 0.0264)
discordbut:SetText('')
discordbut.Paint = function(s, w, h) end
discordbut.DoClick = function(s)
gui_OpenURL('https://gambitrp.ru/discord/')
end
local vkbut = vgui_Create('DButton', TestBoard)
vkbut:SetSize(x * 0.1, y * 0.0475)
vkbut:SetPos(x * 0.3503, y * 0.0264)
vkbut:SetText('')
vkbut.Paint = function(s, w, h) end
vkbut.DoClick = function(s)
gui_OpenURL('https://gambitrp.ru/vk/')
end
local s = vgui_Create('ui_scrollpanel', TestBoard)
s:SetSize(TestBoard:GetWide(), y * 0.567)
s:SetPos(0, y * 0.142)
s:SetSpacing(0.5)
local tab = table_Copy(player_GetAll())
table_sort(tab, function(a, b) return team_GetName(a:Team()) < team_GetName(b:Team()) end)
for k, v in pairs(tab) do
if not v:IsValid() then return end
if v:GetNW2Bool('MaskMe') then continue end
local col = Color(255, 255, 255)
local text = 'Игрок'
for _, i in pairs(Relax.Ranks) do
if v:GetUserGroup() == _ then
col = i[2]
text = i[1]
end
end
local mat = Material('icon16/user.png')
if v:IsUserGroup('superadmin') then
mat = Material('icon16/tux.png')
end
if v:IsUserGroup('user') then
mat = Material('icon16/user.png')
end
if v:IsUserGroup('vip') then
mat = Material('icon16/heart.png')
end
if v:IsUserGroup('admin') then
mat = Material('icon16/award_star_silver_2.png')
end
if v:IsUserGroup('moder') then
mat = Material('icon16/coins.png')
end
if v:IsUserGroup('helper') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('helper+') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('NS-moder') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('NS-admin') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('padmin') then
mat = Material('icon16/coins.png')
end
if v:IsUserGroup('sponsor') then
mat = Material('icon16/coins.png')
end
if v:IsUserGroup('dsuperadmin') then
mat = Material('icon16/coins.png')
end
if v:IsUserGroup('downer') then
mat = Material('icon16/application_xp_terminal.png')
end
if v:IsUserGroup('manager') then
mat = Material('icon16/award_star_gold_3.png')
end
if v:IsUserGroup('NS-helper') then
mat = Material('icon16/award_star_silver_2.png')
end
if v:IsUserGroup('admin_d') then
mat = Material('icon16/award_star_silver_2.png')
end
if v:IsUserGroup('overwatch') then
mat = Material('icon16/award_star_gold_3.png')
end
if v:IsUserGroup('NS-mlmoder') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('NS-mladmin') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('NS-trainee') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('NS-zammanager') then
mat = Material('icon16/rosette.png')
end
if v:IsUserGroup('NS-assistant') then
mat = Material('icon16/shield_add.png')
end
if v:IsUserGroup('uprav') then
mat = Material('icon16/tux.png')
end
local orgname = ''
if v:GetNW2String('orgname') ~= '' then
orgname = v:GetNW2String('orgname')
end
-- if v:GetNW2String('orgname') ~= '' then
-- orgname = v:GetNW2String('orgname')
-- end
if BRICKS_SERVER_GANGNAMES then
if BRICKS_SERVER_GANGNAMES[v:GetGangID()] then
orgname = BRICKS_SERVER_GANGNAMES[v:GetGangID()]
end
end
local p = vgui_Create('DPanel', TestBoard)
p:SetSize(s:GetWide(), (y * 0.0315) / 1.5)
p.Think = function(s)
if not IsValid(v) then
s:Remove()
end
end
local mutebut = vgui_Create('DImageButton', p)
mutebut:SetSize(24, 24)
mutebut:SetImage('icon32/muted.png')
mutebut:Dock(RIGHT)
mutebut.Think = function()
if not IsValid(v) then return end
if (p.Muted == nil or p.Muted ~= v:IsMuted()) then
p.Muted = v:IsMuted()
if (p.Muted) then
mutebut:SetImage('icon32/muted.png')
else
mutebut:SetImage('icon32/unmuted.png')
end
mutebut.DoClick = function(ss)
if not IsValid(v) then return end
v:SetMuted(not p.Muted)
end
mutebut.OnMouseWheeled = function(ss, delta)
if not IsValid(v) then return end
v:SetVoiceVolumeScale(v:GetVoiceVolumeScale() + (delta / 100 * 5))
ss.LastTick = CurTime()
end
mutebut.PaintOver = function(ss, w, h)
if not IsValid(v) then return end
local a = 255 - math_Clamp(CurTime() - (ss.LastTick or 0), 0, 3) * 255
--draw_RoundedBox( 4, 0, 0, w, h, Color( 0, 0, 0, a * 0.75 ) )
draw_SimpleText(math_ceil(v:GetVoiceVolumeScale() * 100) .. '%', 'ScrFancyButtonSmall', w / 2, h / 2, Color(255, 255, 255, a), 1, 1)
end
end
end
p.OnCursorEntered = function()
surface.PlaySound('UI/buttonrollover.wav')
end
local pingwh = (x * 0.009) / 1.25
local matwh = (x * 0.009) / 1.25
p.Paint = function(s, w, h)
if not v:IsValid() then return end
if s:IsHovered() then
draw_RoundedBox(0, 0, 0, w, h, ColorAlpha(v:JobColor(), 170))
else
draw_RoundedBox(0, 0, 0, w, h, ColorAlpha(v:JobColor(), 120))
end
-- if not v:HasGambitPlus() then
-- draw_SimpleText(v:Name(), 'ScrFancyLine', w / 20, h / 2, color_white, 0, 1)
-- elseif v:SteamID() == 'STEAM_0:1:85418510' then
-- draw_SimpleText('[Создатель] ' .. v:Name() or '', 'ScrFancyLine', w / 20, h / 2, Color(230, 15, 15), 0, 1)
-- else
-- draw_SimpleText(v:HasGambitPlus() and '[GMB+] ' .. v:Name() or '', 'ScrFancyLine', w / 20, h / 2, HSVToColor(CurTime() % 6 * 60, 1, 1), 0, 1)
-- end
local pingcolor = v:Ping() >= 200 and Color(155, 55, 55) or v:Ping() >= 350 and Color(166, 0, 0) or Color(5, 241, 0)
draw_SimpleText(v:Name(), 'ScrFancyLine', 45, h / 2, color_white, 1, 1)
draw_SimpleText(v:getDarkRPVar('job'), 'ScrFancyLine', w / 2.75, h / 2, color_white, 1, 1)
draw_SimpleText(orgname, 'ScrFancyLine', w / 1.6, h / 2, color_white, 1, 1)
draw_SimpleText(v:Ping(), 'ScrFancyLine', w / 1.15 + pingwh, h / 2, pingcolor, 1, 1)
surface_SetDrawColor(pingcolor)
surface_SetMaterial(pingmat)
surface_DrawTexturedRect(w / 1.15 - pingwh, h / 2 - pingwh / 2, pingwh, pingwh)
surface_SetDrawColor(Color(255, 255, 255, 255))
surface_SetMaterial(mat)
surface_DrawTexturedRect(w * 0.0315, h / 2 - matwh / 2 + 1, matwh, matwh)
end
p.OnMousePressed = function()
surface.PlaySound('buttons/button15.wav')
local ymove = y / 2 - (TestBoard:GetTall() / 2)
timer_Simple(0, function()
if IsValid(rp) then
rp:Remove()
end
rp = vgui_Create('KPanel')
rp:SetPos(x / 2 + TestBoard:GetWide() / 2, y * 0.2125)
--rp:MoveTo(TestBoard:GetWide() + 400, ymove, 0.2, 0, 1)
rp:SetSize(x * 0.197, y * 0.6335)
rp.Paint = function(s, w, h) end
rp.Think = function(s)
if not IsValid(v) then
s:Remove()
end
end
local info = vgui_Create('DPanel', rp)
info:SetSize(rp:GetWide(), rp:GetTall())
info:SetPos(0, 0)
info.Paint = function(s, w, h)
if not v:IsValid() then return end
draw_RoundedBoxEx(16, 0, 0, w, h, Color(45, 45, 45, 250), false, true, false, true)
draw_RoundedBox(0, 0, y * 0.025, w, 1, Color(54, 54, 54))
draw_SimpleText(text, 'ScrFancyButton', w / 2, y * 0.012, col, 1, 1)
draw_SimpleText(v:Name(), 'ScrFancyButton', x * 0.0575, y * 0.0352, color_white, 0, 3)
draw_SimpleText(v:getDarkRPVar('job'), 'HUDFancyFont', x * 0.07, y * 0.0585, color_white, 0, 3)
local jobgwh = y * 0.0167
surface_SetDrawColor(color_white)
surface_SetMaterial(jobmat)
surface_DrawTexturedRect(x * 0.058, y * 0.0585, jobgwh, jobgwh)
local GetUTimeTotalTime = timeToStr(v:GetNW2Int('playtime') or 0) or ''
draw_SimpleText('Наиграно: ' .. GetUTimeTotalTime .. '.', 'HUDFancyFont', x * 0.0575, y * 0.0785, color_white, 0, 3)
--if LocalPlayer():Team() == TEAM_MODER then
-- ShadowText(v:getDarkRPVar('money') .. '$', 'font22', av:GetWide() + 5, 70, color_white, TLEFT)
--else
-- ShadowText(orgname, 'font22', av:GetWide() + 5, 70, color_white, TLEFT)
--end
draw_RoundedBox(0, 0, y * 0.1135, w, 1, Color(54, 54, 54))
draw_SimpleText('Действия', 'ScrFancyButton', w / 2, y * 0.115, Color(99, 99, 99), 1, 3)
end
av = vgui_Create('AvatarImage', info)
av:SetPos(x * 0.0152, y * 0.0352)
local avatarwh = x * 0.0391
av:SetSize(avatarwh, avatarwh)
av:SetPlayer(v, 75)
local clist = vgui_Create('DPanelList', info)
clist:SetPos(0, y * 0.1482)
clist:SetSize(info:GetWide(), info:GetTall())
clist:EnableVerticalScrollbar(true)
clist:SetSpacing(y * 0.0102)
clist.Paint = function(self, w, h) end
clist.VBar.Paint = function(s, w, h) end
clist.VBar.btnUp.Paint = function(s, w, h) end
clist.VBar.btnDown.Paint = function(s, w, h) end
clist.VBar.btnGrip.Paint = function(s, w, h) end
buttons = {}
table_insert(buttons, {
Title = 'Открыть профиль',
Func = function(pl)
v:ShowProfile()
LocalPlayer():ChatPrint('Вы открыли профиль')
end
})
table_insert(buttons, {
Title = 'Скопировать SteamID',
Func = function(pl)
SetClipboardText(v:SteamID())
LocalPlayer():ChatPrint('Вы скопировали SteamID')
end
})
table_insert(buttons, {
Title = 'Скопировать Имя',
Func = function(pl)
SetClipboardText(v:Nick())
LocalPlayer():ChatPrint('Вы скопировали имя')
end
})
table_insert(buttons, {
Title = 'Позвонить',
Func = function(pl)
LocalPlayer():ConCommand('darkrp call ' .. v:UserID())
end
})
if LocalPlayer():IsModerator() then
table_insert(buttons, {
Title = 'Бан',
Func = function(pl)
ui.StringRequest('Бан ' .. v:Name(), 'Минуты', '', function(text)
ui.StringRequest('Забанить ' .. v:Name(), 'Введите причину', '', function(text2)
RunConsoleCommand('ulx', 'gban', v:Name(), text, text2)
end)
end)
end
})
table_insert(buttons, {
Title = 'Убить',
Func = function(pl)
RunConsoleCommand('ulx', 'slay', v:Name())
end
})
table_insert(buttons, {
Title = 'Тп к нему',
Func = function(pl)
RunConsoleCommand('ulx', 'goto', v:Name())
end
})
table_insert(buttons, {
Title = 'Тп к себе',
Func = function(pl)
RunConsoleCommand('ulx', 'bring', v:Name())
end
})
table_insert(buttons, {
Title = 'Дать пинка',
Func = function(pl)
RunConsoleCommand('ulx', 'slap', v:Name(), '1')
end
})
-- table_insert(buttons, {
-- Title = 'Дать Мут',
-- Func = function(pl)
-- RunConsoleCommand('ulx', 'tmute', v:Name(), '600')
-- end
-- })
-- table_insert(buttons, {
-- Title = 'Дать Гаг',
-- Func = function(pl)
-- RunConsoleCommand('ulx', 'tgag', v:Name(), '600')
-- end
-- })
table_insert(buttons, {
Title = 'Дать Мут',
Func = function(pl)
ui.StringRequest('Дать Мут ' .. v:Name(), 'Секунды', '', function(text)
ui.StringRequest('Замутить ' .. v:Name(), 'Введите причину', '', function(text2)
RunConsoleCommand('ulx', 'tmute', v:Name(), text, text2)
end)
end)
end
})
table_insert(buttons, {
Title = 'Дать Гаг',
Func = function(pl)
ui.StringRequest('Дать Гаг ' .. v:Name(), 'Секунды', '', function(text)
ui.StringRequest('Загагать ' .. v:Name(), 'Введите причину', '', function(text2)
RunConsoleCommand('ulx', 'tgag', v:Name(), text, text2)
end)
end)
end
})
table_insert(buttons, {
Title = 'Убрать Мут',
Func = function(pl)
RunConsoleCommand('ulx', 'untmute', v:Name())
end
})
table_insert(buttons, {
Title = 'Убрать Гаг',
Func = function(pl)
RunConsoleCommand('ulx', 'untgag', v:Name())
end
})
end
for k, but in ipairs(buttons) do
local b = vgui_Create('DButton', clist)
b:SetSize(clist:GetWide(), y * 0.027)
b:SetText('')
b:SetFont('HUDFancyFont')
b:SetTextColor(Color(255, 255, 255))
b.DoClick = but.Func
b.Paint = function(s, w, h)
draw_SimpleText(but.Title, 'HUDFancyFont', w / 2, h / 3, color_white, 1, 1)
local butgradw = x * 0.1266
surface_SetDrawColor(color_white)
surface_SetMaterial(butgradmat)
surface_DrawTexturedRect(w / 2 - butgradw / 2, h - 1, butgradw, 1)
end
clist:AddItem(b)
end
end)
end
local av = vgui_Create('AvatarImage', p)
av:SetPos(0, 0)
av:SetSize((y * 0.0315) / 1.5, (y * 0.0315) / 1.5)
av:SetPlayer(v, 32)
s:AddItem(p)
end
end
hook_Add(‘ScoreboardShow’, ‘rpmod.showsc’, function()
if IsValid(TestBoard) then
TestBoard:Remove()
timer_Destroy(‘RemoveWindow’)
gui_EnableScreenClicker(false)
end
Scoreboard = TestScore()
return false
end)
hook_Add(‘ScoreboardHide’, ‘rpmod.hidesc’, function()
if IsValid(TestBoard) then
TestBoard:Close()
end
if IsValid(rp) then
rp:Remove()
end
end)
Это ошибка:
[scoreboard] lua/includes/util.lua:267: attempt to index local ‘object’ (a function value)
- IsValid - lua/includes/util.lua:267
- v - addons/scoreboard/lua/autorun/client/main.lua:626
3. unknown - lua/includes/modules/hook.lua:96