1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Custom Categories not working with Jobs

Discussion in 'DarkRP Modding Questions & Help' started by StatTrak™ Doggo, Feb 3, 2018.

  1. StatTrak™ Doggo

    StatTrak™ Doggo New Member

    Whenever I load up my server I get this error:

    [ERROR] A runtime error has occurred in "your jobs" on line -1.
    The best help I can give you is this:
    The category of "Police Officer" ("Government Officials") does not exist!
    Hints:
    - Make sure the category is created with DarkRP.createCategory.
    - The category name is case sensitive!
    - Categories must be created before DarkRP finished loading.
    The responsibility for the error above lies with (the authors of) one (or more) of these files:
    your jobs
    ------- End of Simplerr error -------

    Here is the code for my Category:

    --[[-----------------------------------------------------------------------
    Categories
    ---------------------------------------------------------------------------
    The categories of the default F4 menu.
    Please read this page for more information:
    http://wiki.darkrp.com/index.php/DarkRP:Categories
    In case that page can't be reached, here's an example with explanation:
    DarkRP.createCategory{
    name = "Citizens", -- The name of the category.
    categorises = "jobs", -- What it categorises. MUST be one of "jobs", "entities", "shipments", "weapons", "vehicles", "ammo".
    startExpanded = true, -- Whether the category is expanded when you open the F4 menu.
    color = Color(0, 107, 0, 255), -- The color of the category header.
    canSee = function(ply) return true end, -- OPTIONAL: whether the player can see this category AND EVERYTHING IN IT.
    sortOrder = 1, -- OPTIONAL: With this you can decide where your category is. Low numbers to put it on top, high numbers to put it on the bottom. It's 100 by default.
    }
    DarkRP.createCategory{
    name = "Government Officials", -- The name of the category.
    categorises = "jobs", -- What it categorises. MUST be one of "jobs", "entities", "shipments", "weapons", "vehicles", "ammo".
    startExpanded = true, -- Whether the category is expanded when you open the F4 menu.
    color = Color(0, 0, 255, 255), -- The color of the category header.
    canSee = function(ply) return true end, -- OPTIONAL: whether the player can see this category AND EVERYTHING IN IT.
    sortOrder = 2, -- OPTIONAL: With this you can decide where your category is. Low numbers to put it on top, high numbers to put it on the bottom. It's 100 by default.
    }
    Add new categories under the next line!
    ---------------------------------------------------------------------------]]

    And the code for my jobs:

    --[[---------------------------------------------------------------------------
    DarkRP custom jobs
    ---------------------------------------------------------------------------
    This file contains your custom jobs.
    This file should also contain jobs from DarkRP that you edited.
    Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
    Once you've done that, copy and paste the job to this file and edit it.
    The default jobs can be found here:
    https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua
    For examples and explanation please visit this wiki page:
    http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
    Add your custom jobs under the following line:
    ---------------------------------------------------------------------------]]
    --[[---------------------------------------------------------------------------
    DarkRP custom jobs
    ---------------------------------------------------------------------------
    This file contains your custom jobs.
    This file should also contain jobs from DarkRP that you edited.
    Note: If you want to edit a default DarkRP job, first disable it in darkrp_config/disabled_defaults.lua
    Once you've done that, copy and paste the job to this file and edit it.
    The default jobs can be found here:
    https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua
    For examples and explanation please visit this wiki page:
    http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields
    Add your custom jobs under the following line:
    ---------------------------------------------------------------------------]]
    TEAM_COP = DarkRP.createJob("Police Officer", {
    color = Color(0, 0, 255, 255),
    model = {
    "models/portal/nypd/nypdmale_03_arm.mdl",
    "models/portal/nypd/nypdmale_04_arm.mdl",
    "models/portal/nypd/nypdmale_05_arm.mdl",
    "models/portal/nypd/nypdmale_06_arm.mdl",
    "models/portal/nypd/nypdmale_07_arm.mdl"
    },
    description = [[Enforce the laws of that the Mayor sets and obey the Police Chief.]],
    weapons = {"cstm_pistol_glock17", "door_ram", "weapon_stungun"},
    command = "cop",
    max = 10,
    salary = 125,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = true,
    category = "Government Officials",
    sortOrder = 3
    })
    TEAM_PDCHIEF = DarkRP.createJob("Police Chief", {
    color = Color(0, 0, 255, 255),
    model = {
    "models/portal/nypd/nypdmale_03.mdl",
    "models/portal/nypd/nypdmale_04.mdl",
    "models/portal/nypd/nypdmale_05.mdl",
    "models/portal/nypd/nypdmale_06.mdl",
    "models/portal/nypd/nypdmale_07.mdl"
    },
    description = [[Lead the Police Department and obey the Mayor.]],
    weapons = {"cstm_pistol_deaglecstm", "door_ram", "weapon_stungun"},
    command = "pdchief",
    max = 1,
    salary = 175,
    admin = 0,
    vote = true,
    hasLicense = true,
    candemote = true,
    NeedToChangeFrom = TEAM_COP,
    category = "Government Officials",
    sortOrder = 2
    })
    --[[---------------------------------------------------------------------------
    Define which team joining players spawn into and what team you change to if demoted
    ---------------------------------------------------------------------------]]
    GAMEMODE.DefaultTeam = TEAM_CITIZEN
    --[[---------------------------------------------------------------------------
    Define which teams belong to civil protection
    Civil protection can set warrants, make people wanted and do some other police related things
    ---------------------------------------------------------------------------]]
    GAMEMODE.CivilProtection = {
    [TEAM_COP] = true,
    [TEAM_CHIEF] = true,
    [TEAM_MAYOR] = true,
    }
    --[[---------------------------------------------------------------------------
    Jobs that are hitmen (enables the hitman menu)
    ---------------------------------------------------------------------------]]
    DarkRP.addHitmanTeam(TEAM_MOB)
    --[[---------------------------------------------------------------------------
    Define which team joining players spawn into and what team you change to if demoted
    ---------------------------------------------------------------------------]]
    GAMEMODE.DefaultTeam = TEAM_CITIZEN
    --[[---------------------------------------------------------------------------
    Define which teams belong to civil protection
    Civil protection can set warrants, make people wanted and do some other police related things
    ---------------------------------------------------------------------------]]
    GAMEMODE.CivilProtection = {
    [TEAM_COP] = true,
    [TEAM_PDCHIEF] = true,
    [TEAM_MAYOR] = true,
    }
    --[[---------------------------------------------------------------------------
    Jobs that are hitmen (enables the hitman menu)
    ---------------------------------------------------------------------------]]
    DarkRP.addHitmanTeam(TEAM_MOB)

    Some help would be appreciated.
     

Share This Page