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 CP not showing up in Civil Protection category

Discussion in 'DarkRP Modding Questions & Help' started by IceQubed, Sep 1, 2015.

  1. IceQubed

    IceQubed New Member

    Hello, to give my CP and chief CP jobs M9K weapons when they spawn instead of the default DarkRP weapons, I disabled the jobs from being the defaults (in disabled_defaults.lua), copied the defaults into the jobs.lua file and then swapped out the original guns to the M9K ones. They are still named TEAM_POLICE and TEAM_CHIEF.

    However now they are not shown in the F4 job tab as part of the CP team, instead listed as 'other':
    [​IMG]


    I have checked my jobs file and they are listed as in the GAMEMODE.CivilProtection list. Here's my full jobs file:

    Code (Text):
    --[[---------------------------------------------------------------------------
    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 jobs under the following line:
    ---------------------------------------------------------------------------]]

    TEAM_POLICE = DarkRP.createJob("Civil Protection", {
        color = Color(25, 25, 170, 255),
        model = {"models/player/police.mdl", "models/player/police_fem.mdl"},
        description = [[The protector of every citizen that lives in the city.
            You have the power to arrest criminals and protect innocents.
            Hit a player with your arrest baton to put them in jail.
            Bash a player with a stunstick and they may learn to obey the law.
            The Battering Ram can break down the door of a criminal, with a warrant for their arrest.
            The Battering Ram can also unfreeze frozen props (if enabled).
            Type /wanted <name> to alert the public to the presence of a criminal.]],
        weapons = {"arrest_stick", "unarrest_stick", "m9k_colt1911", "stunstick", "door_ram", "weaponchecker"},
        command = "cp",
        max = 4,
        salary = GAMEMODE.Config.normalsalary * 1.45,
        admin = 0,
        vote = true,
        hasLicense = true,
        ammo = {
            ["pistol"] = 60,
        }
    })

    TEAM_CHIEF = DarkRP.createJob("Civil Protection Chief", {
        color = Color(20, 20, 255, 255),
        model = "models/player/combine_soldier_prisonguard.mdl",
        description = [[The Chief is the leader of the Civil Protection unit.
            Coordinate the police force to enforce law in the city.
            Hit a player with arrest baton to put them in jail.
            Bash a player with a stunstick and they may learn to obey the law.
            The Battering Ram can break down the door of a criminal, with a warrant for his/her arrest.
            Type /wanted <name> to alert the public to the presence of a criminal.
            Type /jailpos to set the Jail Position]],
        weapons = {"arrest_stick", "unarrest_stick", "m9k_model500", "stunstick", "door_ram", "weaponchecker"},
        command = "chief",
        max = 1,
        salary = GAMEMODE.Config.normalsalary * 1.67,
        admin = 0,
        vote = false,
        hasLicense = true,
        chief = true,
        NeedToChangeFrom = TEAM_POLICE,
        ammo = {
            ["pistol"] = 60,
        }
    })






    --[[---------------------------------------------------------------------------
    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_POLICE] = true,
        [TEAM_CHIEF] = true,
        [TEAM_MAYOR] = true,
    }

    --[[---------------------------------------------------------------------------
    Jobs that are hitmen (enables the hitman menu)
    ---------------------------------------------------------------------------]]
    DarkRP.addHitmanTeam(TEAM_MOB)
     
     
  2. viper542

    viper542 Active Member

    Make a category in categories.lua

    Put this in your jobs

    Code (Text):
    category = "",
     
  3. IceQubed

    IceQubed New Member

    Thanks - I added them to "Civil Protection" which worked.
     

Share This Page