Hi. I just discovered a bug with my custom jobs in DarkRP. I have a job called "Meth Cook" which works normally, but it shows up again in the F4 menu with another player model and description. It seems to have part of the description of the default Gangster job but with another model.
I cant find anything wrong with my code, but maybe some of you can?
This is my disabled_defaults.lua:
DarkRP.disabledDefaults["jobs"] = {
["chief"] = true,
["citizen"] = false,
["cook"] = true, --Hungermod only
["cp"] = true,
["gangster"] = true,
["gundealer"] = true,
["hobo"] = true,
["mayor"] = false,
["medic"] = true,
["mobboss"] = true,
}
This is my jobs.lua:
TEAM_CINEMA = DarkRP.createJob("Cinema Manager", {
color = Color(100, 130, 207, 255),
model = {"models/player/kleiner.mdl"},
description = [[You hold the keys to the local cinema. Charge citizens for entry tickets and have movie viewings!]],
weapons = {},
command = "cinemamanager",
max = 1,
salary = 300,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Exclusives"
})
TEAM_SPIDERMAN = DarkRP.createJob("Spiderman", {
color = Color(245, 6, 65, 255),
model = {"models/vinrax/player/spiderman.mdl"},
description = [[You possess the power of spiders! Do good deeds and help the law enforcement prevent crime, or take the dark path of a criminal.]],
weapons = {"climb_swep2"},
command = "spiderman",
max = 1,
salary = 380,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Exclusives",
customCheck = function(ply) return CLIENT or table.HasValue({"superadmin", "Gold", "Diamond"}, ply:GetNWString("usergroup")) end,
CustomCheckFailMsg = "Sorry, this job is only available for Gold/Diamond players."
})
--- Citizens ---
TEAM_BANKER = DarkRP.createJob("Bank Manager", {
color = Color(76, 153, 57, 255),
model = {"models/player/kleiner.mdl"},
description = [[As the bank manager you are tasked with protecting the local bank vault. You can also store others printers legally.]],
weapons = {},
command = "bankmanager",
max = 1,
salary = 300,
admin = 0,
vote = false,
hasLicense = true,
candemote = false,
category = "Citizens"
})
TEAM_HOTEL = DarkRP.createJob("Hotel Manager", {
color = Color(124, 219, 91, 255),
model = {
"models/player/hostage/hostage_02.mdl",
"models/player/hostage/hostage_03.mdl"
},
description = [[You have the keys to the local hotel. Rent out apartments/rooms and start building your hotel empire.]],
weapons = {},
command = "hotelmanager",
max = 1,
salary = 250,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens"
})
TEAM_HOBO = DarkRP.createJob("Hobo", {
color = Color(153, 83, 0, 255),
model = {"models/jessev92/player/l4d/m9-hunter.mdl"},
description = [[You are the lowest member of society. You have no permanent home.
Beg for money and build yourself a shack.]],
weapons = {"weapon_bugbait"},
command = "hobo",
max = 4,
salary = 0,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens"
})
TEAM_POPE = DarkRP.createJob("Pope", {
color = Color(76, 170, 191, 255),
model = {"models/t37/papaj.mdl"},
description = [[Spread the words of wisdow of your religion or make a cult following.]],
weapons = {},
command = "pope",
max = 1,
salary = 220,
admin = 0,
vote = false,
hasLicense = false,
candemote = true,
category = "Citizens"
})
TEAM_ALCHEMIST = DarkRP.createJob("Alchemist", {
color = Color(191, 115, 24, 255),
model = {"models/half-dead/steampunk/m_plague.mdl"},
description = [[You have the recipes for magic potions you can sell for profit or use for your own benefit.]],
weapons = {},
command = "alchemist",
max = 1,
salary = 280,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens"
})
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 is allowed to sell firearms to other people. Set up shop and make some money!]],
weapons = {},
command = "gundealer",
max = 2,
salary = 340,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Citizens"
})
-- Civil protection --
TEAM_SECURITY = DarkRP.createJob("Security Guard", {
color = Color(67, 153, 0, 255),
model = {
"models/player/guard_pack/guard_01.mdl",
"models/player/guard_pack/guard_02.mdl",
"models/player/guard_pack/guard_05.mdl",
"models/player/guard_pack/guard_09.mdl"
},
description = [[People or organizations pay for your protection. Use your gun or buy a new one to equip yourself accordingly.]],
weapons = {"m9k_colt1911"},
command = "securityguard",
max = 4,
salary = 320,
admin = 0,
vote = false,
hasLicense = true,
candemote = false,
category = "Civil Protection"
})
TEAM_POLICE = DarkRP.createJob("Police Officer", {
color = Color(76, 94, 191, 255),
model = {
"models/payday2/units/la_cop_1_rebel.mdl",
"models/payday2/units/la_cop_2_player.mdl",
"models/payday2/units/la_cop_4_player.mdl"
},
description = [[You are the protector of every citizen that lives in the city. Protect and serve!]],
weapons = {"arrest_stick", "unarrest_stick", "stunstick", "door_ram", "weaponchecker", "m9k_m92beretta"},
command = "police",
max = 4,
salary = 380,
admin = 0,
vote = false,
hasLicense = true,
candemote = true,
category = "Civil Protection",
PlayerSpawn = function(ply)
ply:SetArmor(20)
end
})
TEAM_CHIEF = DarkRP.createJob("Police Chief", {
color = Color(76, 94, 191, 255),
model = {"models/payday2/units/la_cop_3_player.mdl"},
description = [[You are in charge of the police department. You are the protector of every citizen that lives in the city. Protect and serve!]],
weapons = {"arrest_stick", "unarrest_stick", "stunstick", "door_ram", "weaponchecker", "m9k_m92beretta", "m9k_remington870"},
command = "policechief",
max = 1,
salary = 420,
admin = 0,
vote = true,
hasLicense = true,
candemote = true,
category = "Civil Protection",
NeedToChangeFrom = TEAM_POLICE,
PlayerSpawn = function(ply)
ply:SetArmor(35)
end
})
TEAM_SWAT = DarkRP.createJob("S.W.A.T Officer", {
color = Color(8, 53, 94, 255),
model = {"models/piket_playermodel/piket_playermodel.mdl"},
description = [[You are a S.W.A.T officer, equipped with heavy armor and weaponry. Assist in police raids and help keep the city safe.
Protect and serve!]],
weapons = {"m9k_m4a1", "m9k_m92beretta"},
command = "swat",
max = 4,
salary = 450,
admin = 0,
vote = true,
hasLicense = true,
candemote = true,
category = "Civil Protection",
PlayerSpawn = function(ply)
ply:SetArmor(75)
end
})
--- Criminals ---
TEAM_THIEF = DarkRP.createJob("Burglar", {
color = Color(87, 78, 78, 255),
model = {"models/h-d/2sg/simonplayer.mdl"},
description = [[Burglars can lockpick their way into others homes and steal belongings. ]],
weapons = {"lockpick", "keypad_cracker"},
command = "burglar",
max = 4,
salary = 100,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Criminals"
})
TEAM_PROTHIEF = DarkRP.createJob("Master Thief", {
color = Color(161, 158, 153, 255),
model = {"models/player/group01/cookies114.mdl"},
description = [[A master thief have mastered the art of theft. Master thieves can lockpick their way into others homes faster and pickpocket.]],
weapons = {"pro_lockpick_update", "keypad_cracker", "pickpocket"},
command = "masterthief",
max = 2,
salary = 100,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Criminals",
customCheck = function(ply) return CLIENT or table.HasValue({"superadmin", "Gold", "Diamond"}, ply:GetNWString("usergroup")) end,
CustomCheckFailMsg = "Sorry, this job is only available for Gold/Diamond players."
})
TEAM_METH = DarkRP.createJob("Meth Cook", {
color = Color(219, 195, 21, 255),
model = {"models/bloocobalt/splinter cell/chemsuit_cod.mdl"},
description = [[Cook meth and sell it for profit to those in desperate need. You better be careful not to the caught by the police!]],
weapons = {},
command = "meth",
max = 2,
salary = 200,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Criminals"
})
TEAM_HITMAN = DarkRP.createJob("Hitman", {
color = Color(156, 30, 30, 255),
model = {
"models/agent_47_(saintbrutal)/agent_47_(saintbrutal).mdl",
"models/agent_47_(saintbrutal)_requiem/agent_47_(saintbrutal)_requiem.mdl"
},
description = [[You have one mission and one mission only, to execute anyone that is assigned to your agenda. Do it quick and silently, or
loud and viciously.]],
weapons = {"m9k_model500"},
command = "hitman",
max = 1,
salary = 250,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Criminals"
})
TEAM_TERROR = DarkRP.createJob("Terrorist", {
color = Color(36, 36, 36, 255),
model = {"models/player/guerilla.mdl"},
description = [[You are a terrorist. You hate everybody and feel the only way for justice is through explosions.]],
weapons = {"m9k_m61_frag"},
command = "terrorist",
max = 2,
salary = 150,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Criminals"
})
--- Admin/Mod jobs ---
TEAM_STAFF = DarkRP.createJob("Staff on duty", {
color = Color(88, 182, 230, 255),
model = {"models/freeman/player/left_shark.mdl"},
description = [[A member of staff currently not in a roleplaying situation]],
weapons = {},
command = "onduty",
max = 5,
salary = 100,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
customCheck = function(ply) return CLIENT or table.HasValue({"superadmin", "admin", "moderator"}, ply:GetNWString("usergroup")) end,
CustomCheckFailMsg = "Sorry, this job is only available for plebs."
})
Im greatful for any response that might lead me in the right direction, since I really have no idea what is wrong here.
Creator have probably created a DarkRP job module in the addon, check the addon out, if you find a job located in that just deleted it.
Example of zm methlab from gmodstore
https://files.facepunch.com/forum/upload/264437/8e21960d-4e1a-4d6a-8ae9-1aa07075f3a9/image.png
Here, replace the staff on duty job with this: Better to ply IsAdmin instead of usergoups, then you can create so many admin groups you want without updating jobs.lua
TEAM_STAFF = DarkRP.createJob("Staff on duty", {
color = Color(88, 182, 230, 255),
model = {"models/freeman/player/left_shark.mdl"},
description = [[A member of staff currently not in a roleplaying situation]],
weapons = {},
command = "onduty",
max = 0,
salary = 100,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
customCheck = function(ply) return ply:GetUserGroup() == "admin" or ply:IsAdmin() end,
CustomCheckFailMsg = "Sorry, this job is only available for plebs."
})
You genious. I dont know why I didnt look in the addon itself, you just made my day!
Sorry, you need to Log In to post a reply to this thread.