• help me please create a f4menu categories
    7 replies, posted
Hello, I do not understand how to add a category to the list of works, ie works divided into categories. Look at the code and find function local function allowedCat(option) Help me please! Sorry for my bad english! [URL="https://mega.nz/#!lwkHxIKQ!zYFPBLVO5ljbV7x95h5XjHSKgTzkeln7Q19wi39C6cc"]https://mega.nz/#!lwkHxIKQ!zYFPBLVO5ljbV7x95h5XjHSKgTzkeln7Q19wi39C6cc[/URL] [CODE]MainMenu = MainMenu or {} local function fixShit(panel, label) label:SetText(DarkRP.textWrap(label:GetText(), "TextFont", 480)) local x, y = surface.GetTextWidth(label:GetText(), "TextFont") panel:SetTall(y + 60) end hook.Add("OnPlayerDeath", "MainMenu.OnPlayerDeath", function() MainMenu:Remove() end) FADE_DELAY = 0.3 CATEOGRY_ACTIVE = -1 SELECTED_OPTION = nil function MainMenu:CreateBlur() self.Blur = vgui.Create("MGradient") self.Blur:FadeIn(FADE_DELAY) if self.BarPanel && self.BarPanel:IsValid() then self.BarPanel:FadeOut(FADE_DELAY) end gui.EnableScreenClicker(true) end function MainMenu:GetBlur() return self.Blur && self.Blur:IsValid() end function MainMenu:RemoveBlur() RemoveLastItem() self.Blur:FadeOut(FADE_DELAY, true, function() gui.EnableScreenClicker(false) end) if self.BarPanel && self.BarPanel:IsValid() then self.BarPanel:FadeIn(FADE_DELAY) end end hook.Remove("Think", "MainMenu.Think") local active = false local last_pressed = 0 hook.Add("Think", "MainMenu.Think", function() if last_pressed > CurTime() then return end if !LocalPlayer():Alive() then return end if input.IsKeyDown(KEY_TAB) || input.IsKeyDown(KEY_F4) then if MainMenu:IsValid() then MainMenu:Remove() else MainMenu:Create() last_pressed = CurTime() + 1 end end end) MainMenu.NavigationList = {} function MainMenu:AddNavigation(text, func, onClose, options) return table.insert(self.NavigationList, {text = text, func = func, onClose = onClose, options = options}) end CATEGORY_MAIN = MainMenu:AddNavigation("Главное", function(parent) parent:SetDrawBackground(false) local panel = vgui.Create("MPanel") panel:SetSize(500, ScrH()) panel:SetDrawBackground(false) parent:AddItem(panel) local JobInfo = vgui.Create("MLabel", panel) JobInfo:SetPos(0, 110) JobInfo:SetFont("HeaderFont3") JobInfo:SetColor(RPExtraTeams[LocalPlayer():Team()].color) JobInfo:SetText(RPExtraTeams[LocalPlayer():Team()].name) local WalletInfo = vgui.Create("MLabel", panel) WalletInfo:SetFont("TextFont") WalletInfo:SetText("Кошелек: "..(LocalPlayer().DarkRPVars.money or 0).." рублей") WalletInfo:SetPos(0, 165) WalletInfo:FadeIn(FADE_DELAY) local actionPanel = vgui.Create("MPanelList", panel) actionPanel:SetOffset(0) actionPanel:SetDrawBackground(false) actionPanel:SetPos(0, 175) for k, v in pairs(F1Menu.List) do if !v.check || v.check() then local button = vgui.Create("MButton") button:SetText(v.name) button:OnClick(v.func) actionPanel:AddItem(button) end end end, function(parent) parent:SetDrawBackground(true) end) CATEGORY_JOBS = MainMenu:AddNavigation("Работы", function(parent) local panel = vgui.Create("MPanel") panel:SetSize(500, 95) local label = vgui.Create("MLabel", panel) label:SetPos(10, 2) label:SetFont("HeaderFont3") label:SetColor(COLOR_HOVER) label:SetText("Информация") local label = vgui.Create("MLabel", panel) label:SetPos(15, 50) label:SetFont("TextFont") label:SetText([[Вы можете получить работу с NPC. Вам придется разблокировать некоторые из рабочих мест за деньги.]]) fixShit(panel, label) parent:AddItem(panel) for k, v in pairs(RPExtraTeams) do if v.type then continue end if v.customCheck and not v.customCheck(LocalPlayer()) then continue end if (type(v.NeedToChangeFrom) == "number" and LocalPlayer():Team() ~= v.NeedToChangeFrom) or (type(v.NeedToChangeFrom) == "table" and not table.HasValue(v.NeedToChangeFrom, LocalPlayer():Team())) then continue end local panel = vgui.Create("MModelPanel") if type(v.model) == "table" then panel:SetModel(table.Random(v.model)) else panel:SetModel(v.model) end panel:SetHeaderText(v.name) local desc = "" if (!v.premium || LocalPlayer():IsPremium()) && (!v.unlockCost || (v.unlockCost && table.HasValue(Job.Unlocks, v.command))) then desc = v.description if v.vote then panel:OnClick(function() LocalPlayer():ConCommand("say /vote"..v.command) end) else panel:OnClick(function() LocalPlayer():ConCommand("say /"..v.command) end) end elseif v.premium && !LocalPlayer():IsPremium() then desc = v.description.."\n\nЭта работа доступна только премиум пользователей." elseif v.requireUnlock && !table.HasValue(Job.Unlocks, RPExtraTeams[v.requireUnlock].command) then desc = "Вы должны разблокировать: "..RPExtraTeams[v.requireUnlock].name.."." panel:OnClick(function() LocalPlayer():ConCommand("Job.Unlock "..v.command) end) else desc = "Разблокировать за "..v.unlockCost.." рублей.\n" panel:OnClick(function() local list = vgui.Create("MList") list:AddItem("Вы уверены?") list:AddItem("Нет.", function() end) list:AddItem("Да, я уверен.", function() LocalPlayer():ConCommand("Job.Unlock "..v.command) end) end) end local wep_desc = "" for k, v in pairs(v.weapons) do local w = weapons.Get(v) if w && w.PrintName then wep_desc = (wep_desc != "" && wep_desc..", " or "") .. w.PrintName end end if wep_desc != "" then wep_desc = "\n\nВооружение: "..wep_desc end panel.AdjustSize = true panel:SetDescText(desc..wep_desc) panel:SetHeaderColor(v.color) panel.Model:SetCamPos(Vector( 70, -20, 50 )) panel.Model:SetLookAt(Vector( 0, 0, 65 )) panel.Model:SetFOV(10) panel.Model.Entity:SetSequence(panel.Model.Entity:LookupSequence(table.Random({"idle_all_01", "idle_all_02", "idle_passive"}))) panel.Model:SetRotation(false) parent:AddItem(panel) end end, function() end, { {"Разное", function() return allowedCat("Разное") end}, }) local function allowedCat(option) for k, v in pairs(CustomShipments) do if (option == v.cat || !v.cat && option == "Разное" || option == "Всё") && v.seperate && (not v.allowed[1] || table.HasValue(v.allowed, LocalPlayer():Team())) && (!v.customCheck or (v.customCheck and v.customCheck(LocalPlayer()))) then return true end end for k, v in pairs(CustomShipments) do if (option == v.cat || !v.cat && option == "Разное" || option == "Всё") && not v.noship && table.HasValue(v.allowed, L
1) Nobody wants to download your shitty script. 2) Just copy and paste your shitty script in [noparse][code][/code][/noparse] tags or at least use something like [URL="http://pastebin.com/"]pastebin[/URL].
[QUOTE=Smuggest;51252100]1) Nobody wants to download your shitty script. 2) Just copy and paste your shitty script in [noparse][code][/code][/noparse] tags or at least use something like [URL="http://pastebin.com/"]pastebin[/URL].[/QUOTE] ok
This kid was threatening me with ddos. Fukken lold. [I]next time remove link to your VK page from your code, Daniel :3[/I]
He says about adding a new category in jobs menu? I haven't see in your code a way to do this. You must rebuild jobs panel to add categories.
I am even ready to pay to have helped me.
[QUOTE=Mello009;51252964]I am even ready to pay to have helped me.[/QUOTE] If you're willing to pay, why not use [URL="https://scriptfodder.com/"]ScriptFodder[/URL]?
[QUOTE=smithy285;51253014]If you're willing to pay, why not use [URL="https://scriptfodder.com/"]ScriptFodder[/URL]?[/QUOTE] There I also wrote. No one really did not answer.
Sorry, you need to Log In to post a reply to this thread.