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.

v 2.5.x How to modify the default DarkRP jobs

Discussion in 'Tutorials' started by TypicalRookie, Dec 29, 2013.

  1. TypicalRookie

    TypicalRookie Active Member

    Changing the default jobs in DarkRP 2.4.3 is as simple as opening the shared.lua file and changing around the jobs to how you like. In DarkRP 2.5.x the shared.lua method no longer works, extra steps have to be taken but it makes editing the gamemode a whole lot simpler.

    To start modifying the deafult jobs, the first step is to install the gamemode and install the darkrpmodificationaddon. The gamemode file goes in your
    GarrysMod/garrysmod/gamemodes folder
    and the darkrpmodification addon goes into your
    GarrysMod/garrysmod/addons folder.

    Once you have everything installed, open up the disabled_deafults.lua file in
    GarrysMod\garrysmod\addons\darkrpmodification\lua\darkrp_config\disabled_defaults.lua
    Make sure to open the file with a text editor such as Notepad

    Inside of the disabled_defaults.lua file look for:
    Code (Text):
    /*---------------------------------------------------------------------------
    The disabled default jobs. true to disable, false to enable.

    NOTE: If you disable a job and remake it, expect things that rely on the job to stop working
    e.g. you disable the gundealer and you make a new job as TEAM_GUN. If you want the shipments/door groups/etc. to
    work for your custom job, remake them to include your job as well.
    ---------------------------------------------------------------------------*/
    DarkRP.disabledDefaults["jobs"] = {
        ["chief"]    = false,
        ["citizen"]  = false,
        ["cook"]      = false, --Hungermod only
        ["cp"]        = false,
        ["gangster"]  = false,
        ["gundealer"] = false,
        ["hobo"]      = false,
        ["mayor"]    = false,
        ["medic"]    = false,
        ["mobboss"]  = false,
    }
    This section is what allows you to properly modify your default jobs. Any job that you want to edit must be set to true. Example: ["chief"] = true,. If you leave a job as false then the job will appear in your server and you will not be able to properly modify it. When a job is set to true the job will be disabled and it will not appear in your server. When you disable the job, you can then add it to your jobs.lua be able to modify it.

    Once you have disabled any job you want to modify you then can open this file
    GarrysMod\garrysmod\addons\darkrpmodification\lua\darkrp_customthings\jobs.lua
    This file lets you create any custom job for your server. Since you disabled a default job, you're now able to copy and paste the original jobs code into the jobs.lua to modify it. If you did not disable the original job first before pasting it in to modify it, it will mess things up.

    Continue reading into the next post to view the default jobs. (I am unable to post them here because of 1000 character limit)

    The default jobs can also be found in the GarrysMod\garrysmod\gamemodes\darkrp\gamemode\config\jobrelated.lua
     
    Last edited: Jul 14, 2014
    konamikode likes this.
  2. TypicalRookie

    TypicalRookie Active Member

    The default DarkRP jobs.
    Code (Text):

    TEAM_CITIZEN = DarkRP.createJob("Citizen", {
        color = Color(20, 150, 20, 255),
        model = {
            "models/player/Group01/Female_01.mdl",
            "models/player/Group01/Female_02.mdl",
            "models/player/Group01/Female_03.mdl",
            "models/player/Group01/Female_04.mdl",
            "models/player/Group01/Female_06.mdl",
            "models/player/group01/male_01.mdl",
            "models/player/Group01/Male_02.mdl",
            "models/player/Group01/male_03.mdl",
            "models/player/Group01/Male_04.mdl",
            "models/player/Group01/Male_05.mdl",
            "models/player/Group01/Male_06.mdl",
            "models/player/Group01/Male_07.mdl",
            "models/player/Group01/Male_08.mdl",
            "models/player/Group01/Male_09.mdl"
        },
        description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
        weapons = {},
        command = "citizen",
        max = 0,
        salary = GAMEMODE.Config.normalsalary,
        admin = 0,
        vote = false,
        hasLicense = false,
        candemote = false
    })

    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", "weapon_glock2", "stunstick", "door_ram", "weaponchecker"},
        command = "cp",
        max = 4,
        salary = GAMEMODE.Config.normalsalary * 1.45,
        admin = 0,
        vote = true,
        hasLicense = true,
        ammo = {
            ["pistol"] = 60,
        }
    })

    TEAM_GANG = DarkRP.createJob("Gangster", {
        color = Color(75, 75, 75, 255),
        model = {
            "models/player/Group03/Female_01.mdl",
            "models/player/Group03/Female_02.mdl",
            "models/player/Group03/Female_03.mdl",
            "models/player/Group03/Female_04.mdl",
            "models/player/Group03/Female_06.mdl",
            "models/player/group03/male_01.mdl",
            "models/player/Group03/Male_02.mdl",
            "models/player/Group03/male_03.mdl",
            "models/player/Group03/Male_04.mdl",
            "models/player/Group03/Male_05.mdl",
            "models/player/Group03/Male_06.mdl",
            "models/player/Group03/Male_07.mdl",
            "models/player/Group03/Male_08.mdl",
            "models/player/Group03/Male_09.mdl"},
        description = [[The lowest person of crime.
            A gangster generally works for the Mobboss who runs the crime family.
            The Mob boss sets your agenda and you follow it or you might be punished.]],
        weapons = {},
        command = "gangster",
        max = 3,
        salary = GAMEMODE.Config.normalsalary,
        admin = 0,
        vote = false,
        hasLicense = false
    })

    TEAM_MOB = DarkRP.createJob("Mob boss", {
        color = Color(25, 25, 25, 255),
        model = "models/player/gman_high.mdl",
        description = [[The Mob boss is the boss of the criminals in the city.
            With his power he coordinates the gangsters and forms an efficient crime organization.
            He has the ability to break into houses by using a lockpick.
            The Mob boss posesses the ability to unarrest you.]],
        weapons = {"lockpick", "unarrest_stick"},
        command = "mobboss",
        max = 1,
        salary = GAMEMODE.Config.normalsalary * 1.34,
        admin = 0,
        vote = false,
        hasLicense = false
    })

    TEAM_GUN = DarkRP.createJob("Gun Dealer", {
        color = Color(255, 140, 0, 255),
        model = "models/player/monk.mdl",
        description = [[A Gun Dealer is the only person who can sell guns to other people.
            Make sure you aren't caught selling illegal firearms to the public! You might get arrested!]],
        weapons = {},
        command = "gundealer",
        max = 2,
        salary = GAMEMODE.Config.normalsalary,
        admin = 0,
        vote = false,
        hasLicense = false
    })

    TEAM_MEDIC = DarkRP.createJob("Medic", {
        color = Color(47, 79, 79, 255),
        model = "models/player/kleiner.mdl",
        description = [[With your medical knowledge you work to restore players to full health.
            Without a medic, people cannot be healed.
            Left click with the Medical Kit to heal other players.
            Right click with the Medical Kit to heal yourself.]],
        weapons = {"med_kit"},
        command = "medic",
        max = 3,
        salary = GAMEMODE.Config.normalsalary,
        admin = 0,
        vote = false,
        hasLicense = false,
        medic = true
    })

    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", "weapon_deagle2", "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,
        }
    })

    TEAM_MAYOR = DarkRP.createJob("Mayor", {
        color = Color(150, 20, 20, 255),
        model = "models/player/breen.mdl",
        description = [[The Mayor of the city creates laws to govern the city.
        If you are the mayor you may create and accept warrants.
        Type /wanted <name>  to warrant a player.
        Type /jailpos to set the Jail Position.
        Type /lockdown initiate a lockdown of the city.
        Everyone must be inside during a lockdown.
        The cops patrol the area.
        /unlockdown to end a lockdown]],
        weapons = {},
        command = "mayor",
        max = 1,
        salary = GAMEMODE.Config.normalsalary * 1.89,
        admin = 0,
        vote = true,
        hasLicense = false,
        mayor = true
    })

    TEAM_HOBO = DarkRP.createJob("Hobo", {
        color = Color(80, 45, 0, 255),
        model = "models/player/corpse1.mdl",
        description = [[The lowest member of society. Everybody laughs at you.
            You have no home.
            Beg for your food and money
            Sing for everyone who passes to get money
            Make your own wooden home somewhere in a corner or outside someone else's door]],
        weapons = {"weapon_bugbait"},
        command = "hobo",
        max = 5,
        salary = 0,
        admin = 0,
        vote = false,
        hasLicense = false,
        candemote = false,
        hobo = true
    })
     
     
    Last edited: Jul 14, 2014
    konamikode likes this.
  3. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    Absolutely brilliant!
     
    konamikode and TypicalRookie like this.
  4. Tymek

    Tymek New Member

    And, how i can set the CITIZEN as default?
     
  5. If you want to keep Citizen as default you just keep it as
    ["citizen"] = false,

    False = enabled (it will appear as a job in F4 menu).
    True = disabled (will not appear as a job in F4 menu).
     
    konamikode likes this.
  6. VaultBoy

    VaultBoy New Member

    You are missing some Comma's in DarkRP Default Jobs, and models are case sensitive so you're also messing up there. Now I didn't make an account to diminish your lua skills. But to merely assist you to fix mistake. :D Also apologies I didn't quote because I didn't want people to see a long code again.
     
  7. Tomelyr

    Tomelyr Active Member

    Dafuq are you saying?
    The mdl path as lower case works fine.
    Also i couldnt find missing commas. IIRC the code was ripped f rom the darkrp Source.

    Maybe OP should change it, so ppl search for the code and tell where to find it.
     
    konamikode likes this.
  8. VaultBoy

    VaultBoy New Member

    From Above
    Code (Text):

    TEAM_CITIZEN = DarkRP.createJob("Citizen", {
        color = Color(20, 150, 20, 255),
        model = {
            "models/player/Group01/Female_01.mdl", <-- should be "models/player/group01/female_01.mdl" (trust me you'll get problems if paths aren't correctly entered)
            "models/player/Group01/Female_02.mdl", <-- same problem
            "models/player/Group01/Female_03.mdl", <-- same problem
            "models/player/Group01/Female_04.mdl", <-- same problem
            "models/player/Group01/Female_06.mdl", <-- same problem
            "models/player/group01/male_01.mdl",
            "models/player/Group01/Male_02.mdl", <-- you get the idea
            "models/player/Group01/male_03.mdl", <-- ...
            "models/player/Group01/Male_04.mdl", <-- (the rest you can find).
            "models/player/Group01/Male_05.mdl",
            "models/player/Group01/Male_06.mdl",
            "models/player/Group01/Male_07.mdl",
            "models/player/Group01/Male_08.mdl",
            "models/player/Group01/Male_09.mdl"
        },
        description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]],
        weapons = {},
        command = "citizen",
        max = 0,
        salary = GAMEMODE.Config.normalsalary,
        admin = 0,
        vote = false,
        hasLicense = false,
        candemote = false <-- missing comma
    })
     
    Like I said I'm not here to diminish others skills.
     
    Last edited by a moderator: Apr 29, 2015
  9. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    You're wrong.
    Also, the comma after the last element of a table definition is optional.
     
    konamikode and Tomelyr like this.
  10. TheSkullHead

    TheSkullHead New Member

    Excuse me for being stupid, but does admin = 0, mean that it's availible for everyone? And admin = 1, means it's availible to superadmin only?
     
  11. TypicalRookie

    TypicalRookie Active Member

    admin = 0 - everyone can use the job
    admin = 1 - admins and superadmins can use the job
    admin = 2 - superadmins only can use the job
     
  12. TheSkullHead

    TheSkullHead New Member

    So does that mean only the rank called Admin and SuperAdmin are able to play? Or am i able to configurate what falls under "admin"?
     
  13. Pab14567

    Pab14567 Well-Known Member

    No, it means that admins and super admins if put at 1 can use the job and anything else that is I think hm I forgot the word, but any new rank if you set it to be based of a rank, it has to be admin or super admin in order to get access to those jobs, ugh this is a horrible explanation, I have a performance tomorrow and I have a solo ;-;
     
  14. TheSkullHead

    TheSkullHead New Member

    GL on your performance!
    Also, i get what you're saying. Donut worry.
     

Share This Page