1. 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 Police Jobs

Discussion in 'DarkRP Modding Questions & Help' started by Kermit, Jul 17, 2016.

  1. Kermit

    Kermit New Member

    My custom police jobs are working and i can play them arrest/un-arrest but they can not unlock/ lock pd doors the mayor and the police chief can the 2 jobs that are not custom. I went into doorgroups.lua and put the teams and in the jobs.lua i put the teams as part of civil protection but when i join the server it says that line 42 between "," is nill if i remove the teams the jobs comeback and the stuff works but you cant unlock pd doors. here's the code.
     
  2. Kermit

    Kermit New Member

    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:
    ---------------------------------------------------------------------------]]








    --[[---------------------------------------------------------------------------
    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,
        [TEAM_SWATREG] = true,
        [TEAM_SWATMEDIC] = true,
        [TEAM_SWATCHEIF] = true,
        [TEAM_CHILD] = true,
        [TEAM_SS] = true,
    }

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

    TEAM_SWATMEDIC = DarkRP.createJob("S.W.A.T Medic", {
        color = Color(22, 0, 180, 255),
        model = "models/player/swat.mdl",
        description = [[Your duty is to heal on of your
            wounded operatives. You should stay in the PD
            until backup is needed.
            Do everything you can to keep the city safe.
            You also keep your team healed.]],
        weapons = {"arrest_stick", "unarrest_stick", "m9k_glock", "m9k_m4a1", "stunstick", "door_ram", "weaponchecker", "med_kit", "realrbn_tazer"},
        command = "swatm",
        max = 3,
        salary = 100,
        admin = 0,
        vote = true,
        hasLicense = true,
        category = "Civil Protection",
    })

    TEAM_SWATCHEIF = DarkRP.createJob("S.W.A.T Cheif", {
            color = Color(22, 0, 180, 255),
            model = "models/player/swat.mdl",
            description = [[You're the Cheif of swat you lead your men to put down trouble makers
            if there is no mayor you are the next in command.]],
            weapons = {"arrest_stick", "unarrest_stick", "m9k_glock", "m9k_acr", "stunstick", "door_ram", "weaponchecker", "realrbn_tazer"},
            command = "swatc",
            max = 1,
            salary = 200,
            admin = 0,
            vote = true,
            hasLicense = true,
            category = "Civil Protection",
    })

    TEAM_SWATREG = DarkRP.createJob("S.W.A.T", {
        color = Color(22, 0, 180, 255),
        model = "models/player/swat.mdl",
        description = [[You follow orders from the cheif and you save the city.]],
        weapons = {"arrest_stick", "unarrest_stick", "m9k_glock", "m9k_m4a1", "stunstick", "door_ram", "weaponchecker", "realrbn_tazer"},
        command = "swat",
        max = 3,
        salary = 100,
        admin = 0,
        vote = true,
        hasLicense = true,
        category = "Civil Protection",
    })

    TEAM_OTHER = DarkRP.createJob("Drug Dealer", {
        color = Color(80, 45, 0, 255),
        model = "models/player/eli.mdl",
        description = [[You're a drug dealer. You sell anonymous drugs. doing /advert
            will be instant demotion]],
        weapons = {},
        command = "drug",
        max = 3,
        salary = 15,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Citizens",
    })

    TEAM_OTHER = DarkRP.createJob("Pet", {
        color = Color(255, 255, 0, 255),
        model = "models/doge_player/doge_player.mdl",
        description = [[You're a dog you are loyal to humans.]],
        weapons = {"weapon_dogswep"},
        command = "doge",
        max = 2,
        salary = 0,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Other",
    })

    TEAM_LORD = DarkRP.createJob("Lord Kermit", {
        color = Color(255, 45, 255, 25),
        model = "models/player/kermit.mdl",
        description = [[You're Lord Kermit you rule everything.]],
        weapons = {},
        command = "dos",
        max = 1,
        salary = 10000000000,
        admin = 1,
        vote = false,
        hasLicense = true,
        category = "Staff",
        customCheck = function(ply) return ply:SteamID() == "STEAM_0:0:44182809" end,
        CustomCheckFailMsg = "You're not Lord Kermit! Be gone."
    })

    TEAM_STAFF = DarkRP.createJob("Admin On Duty", {
        color = Color(255, 45, 255, 25),
        model = "models/hunk_orc.mdl",
        description = [[You protect the server from hackers and 12 year olds.]],
        weapons = {},
        command = "AOD",
        max = 2,
        salary = 10000000,
        admin = 1,
        vote = false,
        hasLicense = true,
        category = "Staff",
        customCheck = function(ply) return CLIENT or ply:CheckGroup("moderator, admin, superadmin, owner") end,
        CustomCheckFailMsg = "You need to be a Moderator or Higher to use this job!"
    })
    })

    TEAM_POLICE = DarkRP.createJob("Civil Protection", {
        color = Color(22, 0, 180, 255),
        model = "models/DPFilms/Metropolice/Playermodels/pm_phoenix_police.mdl",
        description = [[Your job is to protect the city and Serve the mayor.]],
        weapons = {"arrest_stick", "unarrest_stick", "m9k_glock", "stunstick", "realrbn_tazer"},
        command = "cp",
        max = 6,
        salary = 65,
        admin = 0,
        vote = true,
        hasLicense = true,
        category = "Civil Protection",
    })
       
    TEAM_THIEF = DarkRP.createJob("Thief", {
        color = Color(255, 250, 255, 255),
        model = "models/player/arctic.mdl",
        description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers.]],
        weapons = {"lockpick",}, -- You may wanna find a pickpocket swep and add it here.
        command = "thief",
        max = 2,
        salary = 65,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Citizens",
    })

    TEAM_HITMAN = DarkRP.createJob("Hitman", {
        color = Color(0, 255, 255, 255),
        model = "models/player/leet.mdl",
        description = [[People hire you to take out other people,
        this job require you to be completely focussed.
        A single breath can make you loose a shot.]],
        weapons = {"m9k_m24"},
        command = "hitman",
        max = 1,
        salary = 65,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Citizens",
    })

    TEAM_SS = DarkRP.createJob("Secret Service", {
        color = Color(100, 20, 20, 255),
        model = "models/player/barney.mdl",
        description = [[You are responsible for protecting the mayor.
        Take care of the old fellow, he is vanuarable to terrorists all the time! Before he enters a room, you need to make sure its secure.]],
        weapons = {"m9k_mp5", "stunstick", "weaponchecker", "realrbn_tazer","arrest_stick", "unarrest_stick"},
        command = "ss",
        max = 2,
        salary = 65,
        admin = 0,
        vote = true,
        hasLicense = false,
            ammo = {
            ["pistol"] = 60,
        },
        category = "Civil Protection",
    })

    TEAM_CHILD = DarkRP.createJob("Mayors Daughter", {
        color = Color(255,100,100,255),
        model = "models/player/alyx.mdl",
        description = [[You are the mayors daughter, walk around with your dad
                    just chill around. But be careful, you never know when somebody
                    is waiting to kidnap you!]],
        weapons = {},
        command = "mayorsdaughter",
        max = 1,
        salary = 80,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Civil Protection",
    })

    TEAM_MTHIEF = DarkRP.createJob("Master Thief", {
        color = Color(0, 0, 0, 255),
        model = "models/player/phoenix.mdl",
        description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers.]],
        weapons = {"lockpick", "m9k_tec9", "pickpocket"}, -- You may wanna find a pickpocket swep and add it here.
        command = "mthief",
        max = 4,
        salary = 110,
        admin = 0,
        vote = false,
        hasLicense = false,
        category = "Citizens",
    })

    TEAM_GUARD = DarkRP.createJob("Guard", {
        color = Color(0,200,50,255),
        model = "models/player/odessa.mdl",
        description = [[People will pay for protection, use your weapon or buy one from the local gundealer.]],
        weapons = {"m9k_colt1911", "stunstick", "weaponchecker", "realrbn_tazer"},
        command = "guard",
        max = 1,
        salary = 85,
        admin = 0,
        vote = false,
        hasLicense = true,
        category = "Citizens",
    })

    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 serve the greater good
        of the people.
        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,
        category = "Civil Protection",
        PlayerDeath = function(ply, weapon, killer)
            ply:teamBan()
            ply:changeTeam(GAMEMODE.DefaultTeam, true)
            if killer:IsPlayer() then
                DarkRP.notifyAll(0, 4, "The mayor has been killed and is therefor demoted.")
            else
                DarkRP.notifyAll(0, 4, "The mayor has died and is therefor demoted.")
            end
        end
    })[code]
     
  3. Kermit

    Kermit New Member

    Sorry code is more than 10000 words together had to post 2 parts

    Code (Text):
    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,
        category = "Gangsters",
    })

    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,
        category = "Gangsters",
    })
     
  4. There is a place where you out your jobs, and you did not put them there. As for the jobs, can we see your doorgroups.lua?
     
  5. ManticorCC

    ManticorCC New Member

    Can you please upload the FULL job.lua file as well as the FULL error from the console?

    http://hastebin.com/
     
  6. Kermit

    Kermit New Member

    Doorgroups.lua
    Code (Text):
    --[[---------------------------------------------------------------------------
    Door groups
    ---------------------------------------------------------------------------
    The server owner can set certain doors as owned by a group of people, identified by their jobs.


    HOW TO MAKE A DOOR GROUP:
    AddDoorGroup("NAME OF THE GROUP HERE, you will see this when looking at a door", Team1, Team2, team3, team4, etc.)
    ---------------------------------------------------------------------------]]


    -- Example: AddDoorGroup("Cops and Mayor only", TEAM_CHIEF, TEAM_POLICE, TEAM_MAYOR)
    -- Example: AddDoorGroup("Gundealer only", TEAM_GUN)
    -- Code generated at: TheCodingBeast.com | DarkRP 2.5 Tools
    AddDoorGroup("Governments", TEAM_SWAT, TEAM_POLICE, TEAM_MAYOR, TEAM_SWATMEDIC, TEAM_SWATCHIEF, TEAM_CHILD, TEAM_CHIEF, TEAM_SS, TEAM_STAFF, TEAM_LORD)
    --- Double Post Merged, Jul 18, 2016 ---
    http://hastebin.com/ifidujogac.lua
    --- Double Post Merged, Jul 18, 2016 ---
    i took the teams out of the civil protection because as of right now it takes all the custom jobs off
     

Share This Page