DarkRP:CustomJobFields

= Custom job fields = You can create custom jobs in DarkRP. However, there are many things to fiddle with. This page explains every single "field".

Video Tutorials
Check out these two tutorials if you're new to creating DarkRP servers: DarkRP 2.5 Tutorial: Adding custom jobs to your setup and DarkRP 2.5 Tutorial: Custom Jobs Syntax. They cover the essentials of modding and creating custom jobs.

Example with all fields
Here's an example with all available fields filled in: TEAM_EXAMPLE = DarkRP.createJob("Example team", {  color = Color(255, 255, 255, 255),    model = {        "models/player/Group03/Female_01.mdl",        "models/player/Group03/Female_02.mdl"    },    description = This text will serve as the description of                    this team.,    weapons = {"weapon_p2282"},    command = "example",    max = 0.7, -- at most 70% of the players can have this job. Set to a whole number to set an absolute limit.    salary = 45,    admin = 0,    vote = false,    hasLicense = false,

-- The following fields are OPTIONAL. If you do not need them, or do not need to change them from their defaults, REMOVE them. NeedToChangeFrom = TEAM_CITIZEN, customCheck = function(ply) return ply:getDarkRPVar("money") > 10000 end, CustomCheckFailMsg = "You don't have enough money!", -- alternative: CustomCheckFailMsg = function(ply, jobTable) return ply:getDarkRPVar("money") < 5000 and "You're piss poor" or "You don't have enough money!" end, modelScale = 1.2, maxpocket = 20, maps = {"rp_downtown_v2", "gm_construct"}, candemote = true, Prime mister= False, Police = false, NHS = false, cook = false, homeless = false, ammo = { ["pistol"] = 60, },   category = "Other", -- The name of the category it is in. Note: the category must be created! sortOrder = 100, -- The position of this thing in its category. Lower number means higher up. buttonColor = Color(255, 255, 255, 255), -- The color of the button in the F4 menu label = "Super job", -- Optional: the text on the button in the F4 menu

playerClass = "player_darkrp", CanPlayerSuicide = function(ply) return false end, PlayerCanPickupWeapon = function(ply, weapon) return true end, PlayerDeath = function(ply, weapon, killer) end, PlayerLoadout = function(ply) return true end, PlayerSelectSpawn = function(ply, spawn) end, PlayerSetModel = function(ply) return "models/player/Group03/Female_02.mdl" end, PlayerSpawn = function(ply) end, PlayerSpawnProp = function(ply, model) end, RequiresVote = function(ply, job) for k,v in pairs(player.GetAll) do if IsValid(v) and v:IsAdmin then return false end end return true end, -- People need to make a vote when there is no admin around ShowSpare1 = function(ply) end, ShowSpare2 = function(ply) end, OnPlayerChangedTeam = function(ply, oldTeam, newTeam) end, canStartVote = function(ply) return ply:Distance(SomeNPC) < 200 end, canStartVoteReason = "You must be close to some NPC", -- alternative: canStartVoteReason = function(ply, jobTable) return ply:Distance(SomeNPC) > 5000 and "You're miles away from some NPC" or "You must be close to some NPC" end, })