• Вопрос Вопрос
Вопрос Ошибка в скриграбе бадминка

Всем привет. Проблема такая , я пытаюсь заскгринграбить человека , скрин в дату сохраняется , но на экран его не выводит.
1673848026306.png

В консоль сервера выписывается вот такая ошибка:
Lua:
Развернуть Свернуть Копировать
addons/[admin] badmin/lua/ba/plugins/sg.lua:41: bad argument #2 to 'WriteStream' (function expected, got Player)
stack traceback:
        [C]: in function 'error'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:154: in function 'WriteStream'
        addons/[admin] badmin/lua/ba/plugins/sg.lua:41: in function <addons/[admin] badmin/lua/ba/plugins/sg.lua:38>
        [C]: in function 'xpcall'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:63: in function 'Remove'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:48: in function 'Read'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:349: in function 'func'
        gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:580: in function <gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:559>
[[tool] advdupe2] Warning! A net message (ba.cmd.sg.disp) is already started! Discarding in favor of the new message! (NetStreamRequest)
  1. Remove - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:66
   2. Read - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:48
    3. func - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:349
     4. unknown - gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:580

addons/[admin] badmin/lua/ba/plugins/sg.lua:41: bad argument #2 to 'WriteStream' (function expected, got Player)
stack traceback:
        [C]: in function 'error'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:154: in function 'WriteStream'
        addons/[admin] badmin/lua/ba/plugins/sg.lua:41: in function <addons/[admin] badmin/lua/ba/plugins/sg.lua:38>
        [C]: in function 'xpcall'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:63: in function 'Remove'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:48: in function 'Read'
        addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:349: in function 'func'
        gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:580: in function <gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:559>
[[tool] advdupe2] Warning! A net message (ba.cmd.sg.disp) is already started! Discarding in favor of the new message! (NetStreamRequest)
  1. Remove - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:66
   2. Read - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:48
    3. func - addons/[tool] advdupe2/lua/advdupe2/sh_netstream.lua:349
     4. unknown - gamemodes/darkrp/gamemode/modules/adminsystem/init_sv.lua:580
Как фиксить?

  • Вопрос Вопрос
Вопрос Вопрос по веапону селектору

Можно ли как-то оружие перенести во вкладку оружия.
1673845038418.png

пытался прописать в самом конфиге этого селектора , но безуспешно.
Lua:
Развернуть Свернуть Копировать
local categories = {
    'Строительство',
    'Ролеплей',
    'Другое',
    'Оружие'
}

local weaponMap = {
    weapon_physgun = {
        Name = 'Физ-Ган',
        Slot = 1
    },
    weapon_physcannon = {
        Name = 'Гравити-Ган',
        Slot = 1
    },
    weapon_rpg = {
        Name = 'RPG',
        Slot = 4
    },
    weapon_crossbow = {
        Name = 'Crossbow',
        Slot = 4
    },
    weapon_crowbar = {
        Name = 'Монтировка',
        Slot = 3
    },
    weapon_slam = {
        Name = 'SLAM',
        Slot = 4
    },
    itemstore_pickup = {
        Name = 'Инвентарь',
        Slot = 2
    },
    keys = {
        Name = 'Ключи',
        Slot = 2
    },
    weapon_stunstick = {
        Name = 'Stunstick',
        Slot = 4
    }
}   

local function getWeaponSlot(wep)
    if (wep.GetSwitcherSlot) then
        wep.Slot = wep:GetSwitcherSlot()
    end

    local map = weaponMap[wep:GetClass()]
    return (wep.Slot and math.Clamp(wep.Slot, 1, 4)) or (map and map.Slot) or 2
end

local wepsCache = {}
local weaponsByCategory = {}
local weaponsByOrder = {}
local weaponsByClass = {}
local selectedWeapon = -1
local lastCache = CurTime()
local function ensureWeapons(force)
    local weps = LocalPlayer():GetWeapons()

    if (lastCache <= CurTime() or force) then
        wepsCache = weps

        table.Empty(weaponsByCategory)
        table.Empty(weaponsByOrder)
        table.Empty(weaponsByClass)
        for k, cat in ipairs(categories) do
            local wepSlot = k

            weaponsByCategory[wepSlot] = {}
            for _, wep in pairs(weps) do
                if (getWeaponSlot(wep) == wepSlot) then
                    local ind = table.insert(weaponsByCategory[wepSlot], {
                        ID = #weaponsByOrder + 1,
                        Class = wep:GetClass(),
                        Name = (weaponMap[wep:GetClass()] and weaponMap[wep:GetClass()].Name) or wep.PrintName or wep:GetClass(),
                        Ent = wep
                    })

                    weaponsByOrder[#weaponsByOrder + 1] = weaponsByCategory[wepSlot][ind]
                    weaponsByClass[wep:GetClass()] = weaponsByCategory[wepSlot][ind]
                end
            end
        end
    end

    if (selectedWeapon == 0 and IsValid(LocalPlayer():GetActiveWeapon()) and weaponsByClass[LocalPlayer():GetActiveWeapon():GetClass()]) then
        selectedWeapon = weaponsByClass[LocalPlayer():GetActiveWeapon():GetClass()].ID
    end

    lastCache = CurTime() + 0.25
end

local showTime = 0
local fadeTime = 0

local lastWep
local currentWep
local function switchWeapon(wep)
    wep = wep or weaponsByOrder[selectedWeapon]

    showTime = 0

    if not wep then
        return
    end

    lastWep = currentWep
    currentWep = wep

    if not IsValid(LocalPlayer():GetActiveWeapon()) or LocalPlayer():GetActiveWeapon() ~= wep.Ent then
        input.SelectWeapon(wep.Ent)
    else
        return
    end

    surface.PlaySound('buttons/lightswitch2.wav')
    return true
end

local color_white         = ui.col.White
local color_flatblack     = ui.col.FlatBlack
local color_background     = ui.col.Background
local color_highlight     = ui.col.TransWhite100
local color_sup         = ui.col.SUP
local color_red         = ui.col.Red

function GM:DrawWepSwitch()
    local st = SysTime()
    local w, h = 185, 35
    local x, y = (ScrW() - #categories * (w + 3)) * 0.5, 35

    if (showTime + 0.25 <= st) then return end
    ensureWeapons()

    if (showTime <= st) then
        surface.SetAlphaMultiplier(Lerp((st - showTime) / 0.1, 1, 0))
    else
        surface.SetAlphaMultiplier(Lerp((st - fadeTime) / 0.1, 0, 1))
    end

    for k, cat in ipairs(categories) do
        local x, y = x + ((k - 1) * (w + 3)), y
        local wepSlot = k
        draw.Box(x, y, w, h, color_flatblack)
        draw.SimpleText(wepSlot, 'ui.17', x + 3, h + 3, color_sup, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
        draw.SimpleText(cat, 'ui.20', x + (w * 0.5), y + (h * 0.5), color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)

        for i, wep in ipairs(weaponsByCategory[wepSlot]) do
            local y = y + (i * (h + 3))
            draw.Box(x, y, w, h, color_background)

            if (wep.ID == selectedWeapon) then
                draw.Box(x, y, w, h, color_highlight)
            end

            draw.SimpleText(wep.Name, 'ui.18', x + 5, y + 3, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

            if (not IsValid(wep.Ent)) then continue end

            local clip1, maxClip1 = wep.Ent:Clip1(), wep.Ent:GetMaxClip1()
            local isUnlimited = (maxClip1 < 1) and (clip1 < 1) or (not wep.Ent.DrawAmmo)

            draw.SimpleText(isUnlimited and '∞' or (clip1 .. '/' .. maxClip1) , 'ui.17', (x + w) - 5, (y + h) - 3, ((not isUnlimited) and (clip1 == 0)) and color_red or color_sup, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM)
        end
    end
end

local lastSnd = 0
hook('PlayerBindPress', 'rp.wepswitch.PlayerBindPress', function(pl, bind, pressed)
    if (!pressed) then return end
    if (!LocalPlayer():Alive()) then return end
    if (!IsValid(LocalPlayer():GetActiveWeapon())) then return end
    if (table.Count(LocalPlayer():GetWeapons()) <= 1) then return end

    local wep = pl:GetActiveWeapon()

    if IsValid(wep) and wep.SWBWeapon and wep.dt and (wep.dt.State == SWB_AIMING) and wep.AdjustableZoom then
        return
    end

    if hook.Call('SuppressWeaponSwitcher', nil, pl, bind, pressed) then return end

    if ((bind == 'invprev') or (bind == 'lastinv') or (bind == 'invnext') or (string.sub(bind, 1, 4) == 'slot')) and (not pl:KeyDown(IN_ATTACK)) then
        if (bind == 'lastinv') and lastWep and IsValid(lastWep.Ent) then
            switchWeapon(lastWep)
            selectedWeapon = currentWep.ID
        elseif (string.sub(bind, 1, 3) == 'inv') then
            if (showTime < SysTime()) then
                ensureWeapons(true)
                selectedWeapon = 0
            else
                local scroll = (bind == 'invprev') and -1 or 1

                selectedWeapon = selectedWeapon + scroll
                if (!weaponsByOrder[selectedWeapon]) then
                    selectedWeapon = (scroll == 1 and 1) or #weaponsByOrder
                end
            end
        else -- using number keys
            if (showTime < SysTime()) then
                ensureWeapons(true)
                fadeTime = SysTime()
            end

            local slot = tonumber(string.sub(bind, -1))

            if (!categories[slot]) then return end

            if (weaponsByCategory[slot][1]) then
                local found = false
                for k, v in ipairs(weaponsByCategory[slot]) do
                    if (v.ID == selectedWeapon) then
                        found = true

                        if (weaponsByCategory[slot][k + 1]) then
                            selectedWeapon = v.ID + 1
                        else
                            selectedWeapon = weaponsByCategory[slot][1].ID
                        end

                        break
                    end
                end

                if (!found) then
                    selectedWeapon = weaponsByCategory[slot][1].ID
                end
            end
        end

        ensureWeapons(true)
        showTime = SysTime() + 2

        if (lastSnd < SysTime() - 0.05) then
            surface.PlaySound('garrysmod/ui_hover.wav')
            lastSnd = SysTime()
        end
    elseif (showTime > SysTime() and bind == '+attack') then
        showTime = 0
        if (IsValid(LocalPlayer():GetActiveWeapon()) and weaponsByOrder[selectedWeapon] and weaponsByClass[LocalPlayer():GetActiveWeapon():GetClass()] and selectedWeapon != weaponsByClass[LocalPlayer():GetActiveWeapon():GetClass()].ID) then
            switchWeapon()
        end
        return true
    elseif (bind == 'phys_swap') then
        showTime = 0
    end
end)

  • Закрыта
  • Решено
Вопрос Проблема

Крч из данной темы Вопрос - Как прописать спавн профессиям через jobs.lua? я скачал 2 луа файла чтобы прописать спавн професии в jobs.lua и узнать координаты(эта фича есть в гамбит рп) но когда я указал координаты спавна професий в jobs.lua затем зашел на сервер я заспавнился под картой.В консоле была ошибка:
Код:
Развернуть Свернуть Копировать
[ulib] lua/autorun/server/sv_ispawn.lua:5: attempt to index global 'spawnInt' (a nil value)
  1. fn - lua/autorun/server/sv_ispawn.lua:5
   2. unknown - addons/ulib 2/lua/ulib/shared/hook.lua:109


[ulib] lua/autorun/server/sv_ispawn.lua:5: attempt to index global 'spawnInt' (a nil value)
  1. fn - lua/autorun/server/sv_ispawn.lua:5
   2. Call - addons/ulib 2/lua/ulib/shared/hook.lua:109
    3. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:722
Как решить данную проблему?

  • Решено
Вопрос Крашит сервак без каких-либо ерророк или логов в консоль.

Просто ни с того ни с сего у сервака повышается нагрузка ЦП до 100% ( доступно 200% ) после чего у всех вылетает сервак, консоль не работает и только в некоторых случаях серваку всё таки удаётся ожить, но всё равно нагрузка с периодичностью где-то в 5-10 секунд скачет до 100%. Есть ли возможные решения?
1673801190629.png

  • Вопрос Вопрос
Вопрос Ошибка 0x602

Ошибка:
Error! App '4020' state is 0x602 after update job.
Кто знает что делать ?
Фото:
1673790752016.png
Описание:
Все наверно скачивали steamcmd.exe
Вот при загрузке процесса 4020 (Сам Гарис )
Проходит загрузка до 90% и прилетает Error.
Кто знает как решить помогите.​

  • Вопрос Вопрос
Вопрос Пропали надписи на дверях после установки худа для дарк рп

Что делать если пропали надписи на дверях(Например:Не куплено.Нажмите ф2 чтобы купить и тд)после установки худа.Худ я установил в addons.Как вернуть надписи на дверях,не удаляя худ?

  • Закрыта
  • Решено
Вопрос Товарищи! Как поменять режим сервера?

Столкнулся с проблемой, создаю сервер на MilitaryRP, однако скачал DarkRP, я переименовал в папке gamemodes darkrp в militaryrp, потом залез в конфиги init.lua и cl_init.lua. Поменял там данные строчки:

GM.Version = "1.1.1"
GM.Name = "MilitaryRP"
GM.Author = "Test"

Далее написал в файле autoexec, папке cfg, gamemode militaryrp.
Однако при загрузке сервера, выдает ошибку, что gamemode militaryrp не обнаружен. В настройках старта сервера militaryrp также поставил. Помогите пожалуйста!

  • Вопрос Вопрос
Вопрос Проблема с Gprotect

Приветствую снова. Gprotect выдает такую ошибку, не понимаю что с ним стало.

Ошибка:
Развернуть Свернуть Копировать
[[protect] gprotect] addons/[protect] gprotect/lua/g_protect/sh_gprotect.lua:38: attempt to index a nil value
  1. GetLang - addons/[protect] gprotect/lua/g_protect/sh_gprotect.lua:38
   2. func - addons/[protect] gprotect/lua/g_protect/client/cl_gprotect.lua:674
    3. unknown - lua/includes/modules/hook.lua:241 (x126)



Сам код в котором возникает ошибка:
сам код:
Развернуть Свернуть Копировать
gProtect = gProtect or {}

local sidlink = {}

gProtect.GetOwner = function(ent)
    if !IsValid(ent) then return end
    local result = ent:GetNWString("gPOwner", "")
    local foundply = player.GetBySteamID( result )
    
    foundply = !isstring(foundply) and (IsValid(foundply) and foundply:IsPlayer() and foundply) or foundply

    return (foundply and foundply) or nil
end

gProtect.HasPermission = function(ply)
    local usergroup = ply:GetUserGroup()

    return gProtect.config.ConfigPermission[usergroup] and gProtect.config.ConfigPermission[usergroup] or CAMI and isfunction(CAMI.PlayerHasAccess) and CAMI.PlayerHasAccess(ply, "gProtect_Settings", function() return false end) or false
end

gProtect.GetLang = function(translation, module, var1, var2, var3)
    local response

    if module then
        if var1 then
            response = gProtect.language[module][gProtect.config.SelectedLanguage] and gProtect.language[module][gProtect.config.SelectedLanguage][var1]
            if !response then response = gProtect.language[module]["eng"][var1] end
            if var2 then
                response = gProtect.language[module] and gProtect.language[module][gProtect.config.SelectedLanguage] and gProtect.language[module][gProtect.config.SelectedLanguage][var1] and gProtect.language[module][gProtect.config.SelectedLanguage][var1][var2]
                if !response then response = gProtect.language[module]["eng"][var1][var2] end
                if var3 then
                    response = gProtect.language[module] and gProtect.language[module][gProtect.config.SelectedLanguage] and gProtect.language[module][gProtect.config.SelectedLanguage][var1] and gProtect.language[module][gProtect.config.SelectedLanguage][var1][var2] and gProtect.language[module] and gProtect.language[module][gProtect.config.SelectedLanguage] and gProtect.language[module][gProtect.config.SelectedLanguage][var1] and gProtect.language[module][gProtect.config.SelectedLanguage][var1][var2][var3]
                    if !response then response = gProtect.language[module]["eng"][var1][var2][var3] end
                end
            end
        end
    else
        response = gProtect.language[gProtect.config.SelectedLanguage][translation]
        if !response then response = gProtect.language["eng"][translation] end
    end

    return response
end

gProtect.HandlePermissions = function(ply, ent, permission)
    if (!IsValid(ent) and !ent:IsWorld()) or ent:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() then return false end

    local owner = gProtect.GetOwner(ent)
    local weapon = permission and permission or IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():GetClass() or "weapon_physgun"
    local ownsid = isstring(owner) and owner or IsValid(owner) and owner:SteamID() or ""

    if (ply == owner) or (gProtect.TouchPermission and gProtect.TouchPermission[ownsid] and gProtect.TouchPermission[ownsid][weapon] and !isnumber(gProtect.TouchPermission[ownsid][weapon]) and gProtect.TouchPermission[ownsid][weapon][ply:SteamID()]) then
        return true
    end
    
    if owner == "World" and gProtect.TouchPermission and gProtect.TouchPermission[owner] then
        local touchtbl = gProtect.TouchPermission[owner][weapon]
        if !touchtbl then return false end
        
        if touchtbl["*"] or touchtbl[ply:GetUserGroup()] then return true end
    end
    
    if ent:IsWorld() then return nil end

    return false, true
end

hook.Add( "PhysgunPickup", "gP:PhysgunPickupLogic", function( ply, ent, norun )
    if TCF and TCF.Config and ent:GetClass() == "cocaine_cooking_pot" and IsValid( ent:GetParent() ) then return nil end --- Compatibilty with the cocaine factory.

    if ent:IsPlayer() then return nil end

    if SERVER then
        local servercheck = gProtect.HandlePhysgunPermission(ply, ent)
        if isbool(servercheck) then return servercheck end
    end
    
    return gProtect.HandlePermissions(ply, ent, "weapon_physgun")
end )

if CAMI and isfunction(CAMI.RegisterPrivilege) then CAMI.RegisterPrivilege({Name = "gProtect_Settings", hasAccess = false, callback = function() end}) CAMI.RegisterPrivilege({Name = "gProtect_StaffNotifications", MinAccess = "admin", hasAccess = false, callback = function() end}) end

Пользователи онлайн

Статистика форума

Темы
29,178
Сообщения
187,189
Пользователи
129,093
Новый пользователь
shkedyt
Назад
Сверху Снизу