• Jobs.lua doesn't work
    17 replies, posted
When I join my server, I'm left with the 9 basic jobs, the custom made ones dont exist on the server [code]TEAM_THIEF = DarkRP.createJob("Thief", { color = Color(0, 0, 0, 255), model = "models/player/robber.mdl", description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers.]], weapons = {"lockpick"}, {"m9k_m29satan"}-- 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, 0, 0, 255), model = "models/player/sunabouzu.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_SWAT = DarkRP.createJob("Swat", { color = Color(25, 25, 170, 255), model = {"models/player/swat.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_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs", "m9k_acr"}, command = "Swat", max = 4, salary = 85, admin = 0, vote = true, hasLicense = true, category = "Civil Protection", }) TEAM_SWATSNIPER = DarkRP.createJob("S.W.A.T Sniper", { color = Color(30, 45, 105, 255), model = "models/player/riot.mdl", description = [[You are a S.W.A.T, Your job is to handle the bigger crimes in the city. You are a Sniper Specialist]], weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "ls_sniper", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "m9k_intervention"}, command = "swatsniper", max = 2, salary = 125, admin = 0, vote = true, hasLicense = true, }) TEAM_GUARD = DarkRP.createJob("Guard", { color = Color(0,200,50,255), model = "models/player/combat_batman/combat_batman.mdl", description = [[People will pay for protection, use your weapon or buy one from the local gundealer.]], weapons = {"weapon_deagle2"}, command = "guard", max = 1, salary = 85, admin = 0, vote = false, hasLicense = true, category = "Citizens", }) TEAM_SADMIN = DarkRP.createJob("Riz On Duty", { color = Color(170, 0, 0, 255), model = "models/sinful/mariob_hatless.mdl", description = [[No fear, riz is here!.]], weapons = {"arrest_stick", "unarrest_stick", "spiderman's_swep"}, command = "sadminonduty", max = 0, salary = 6969420, admin = 1, vote = false, hasLicense = true, }) TEAM_MEMELORD = DarkRP.createJob("Huddy The Meme Lord", { color = Color(0, 0, 0, 255), model = {"models/narry/shrek_playermodel_v1.mdl"}, description = [[]], weapons = {}, command = "MEMELORD", max = 1, salary = 6969420, admin = 2, vote = false, hasLicense = true, candemote = true, -- CustomCheck medic = false, chief = false, mayor = false, hobo = false, cook = false, category = "", }) TEAM_JOBBER = DarkRP.createJob("Jobber On Duty", { color = Color(0, 0, 0, 255), model = {"models/player/anon/anon.mdl"}, description = [[Jobber is here when you need him]], weapons = {"arrest_stick", "unarrest_stick", "spiderman's_swep"}, command = "JobberOnDuty", max = 1, salary = 6969420, admin = 2, vote = false, hasLicense = true, candemote = true, -- CustomCheck medic = false, chief = false, mayor = false, hobo = false, cook = false, category = "", })[/code] Please help me find the solution.
Any server console errors?
Can you edit the post and put wrap the text with the [.code]Your code here[/.code] it'd be much easier to read. Without the periods in the brackets though
[QUOTE=Matsumoto;50691813]Any server console errors?[/QUOTE] [code][Riz #GGPOL|5|STEAM_0:1:52853021] Lua Error: [ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:19: '}' expected (to close '{' at line 14) near 'command' 1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0[/code]
[QUOTE=Rizerino;50691899][code][Riz #GGPOL|5|STEAM_0:1:52853021] Lua Error: [ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:19: '}' expected (to close '{' at line 14) near 'command' 1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0[/code][/QUOTE] You forgot to put brackets around the model in the thief job. actually in every job but the swat sniper.
Line 5: [CODE] weapons = {"lockpick"}, {"m9k_m29satan"}-- You may wanna find a pickpocket swep and add it here. [/CODE] how it should be [CODE] weapons = {"lockpick", "m9k_m29satan"}, -- You may wanna find a pickpocket swep and add it here. [/CODE] [editline]11th July 2016[/editline] Watch out for commas and tables.
You forgot a comma after the weapons in the thief job. Got ninja'd by geferon.
[QUOTE=Thane;50691923]You forgot to put brackets around the model in the thief job. actually in every job but the swat sniper.[/QUOTE] which brackets? lol
[QUOTE=Thane;50691923]You forgot to put brackets around the model in the thief job. actually in every job but the swat sniper.[/QUOTE] You only put the brackets around the models when you have more than one model for the given job.
snip.
[QUOTE=Matsumoto;50691963]You only put the brackets around the models when you have more than one model for the given job.[/QUOTE] so it should be = model = "{models/player/robber.mdl}", ?
[QUOTE=Rizerino;50691973]so it should be = model = "{models/player/robber.mdl}", ?[/QUOTE] If it has one model you do it without the brackets. [url]https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua#L93[/url] If you have multiple models you do it with. [url]https://github.com/FPtje/DarkRP/blob/master/gamemode/config/jobrelated.lua#L40[/url] Also, don't put the brackets inside of the string, you want to do [code]model = {"models/player/robber.mdl"},[/code]
That goes to show how long it's been since I've done DarkRP jobs lol
[QUOTE=Thane;50691991]That goes to show how long it's been since I've done DarkRP jobs lol[/QUOTE] I haven't done jobs either, but it's good to check the github of the gamemode you're modifying to see how the author is doing it.
I don't really understand by what you mean, can you just fix it for me? xD
If you're going to be modifying a server you need to learn basic lua, if you do what @geferon said it will work. I would advise you to learn lua though. You can find all of the information here. [url]https://facepunch.com/showthread.php?t=1250283[/url]
[QUOTE=geferon;50691930]Line 5: [CODE] weapons = {"lockpick"}, {"m9k_m29satan"}-- You may wanna find a pickpocket swep and add it here. [/CODE] how it should be [CODE] weapons = {"lockpick", "m9k_m29satan"}, -- You may wanna find a pickpocket swep and add it here. [/CODE] [editline]11th July 2016[/editline] Watch out for commas and tables.[/QUOTE] Thank you, I was about to give up, I just realised that mistake! [editline]11th July 2016[/editline] [QUOTE=Rizerino;50692039]Thank you, I was about to give up, I just realised that mistake![/QUOTE] Nope, didn't work, Is there a way to delete all files and change to TTT? I'm getting pissed off, I don't see the error. These are the files, I customised some stuff that people recommended [code]--[[--------------------------------------------------------------------------- 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_THIEF = DarkRP.createJob("Thief", { color = Color(0, 0, 0, 255), model = "models/player/robber.mdl", description = [[You are a thief, rob people, lockpick their house and steal their plants and legal printers.]], weapons = {"lockpick", "m9k_m29satan"}-- 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, 0, 0, 255), model = "models/player/sunabouzu.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_SWAT = DarkRP.createJob("Swat", { color = Color(25, 25, 170, 255), model = {"models/player/swat.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_m92beretta", "stunstick", "door_ram", "weaponchecker", "handcuffs", "m9k_acr"}, command = "Swat", max = 4, salary = 85, admin = 0, vote = true, hasLicense = true, category = "Civil Protection", }) TEAM_SWATSNIPER = DarkRP.createJob("S.W.A.T Sniper", { color = Color(30, 45, 105, 255), model = "models/player/riot.mdl", description = [[You are a S.W.A.T, Your job is to handle the bigger crimes in the city. You are a Sniper Specialist]], weapons = {"arrest_stick", "unarrest_stick", "weapon_glock2", "ls_sniper", "weapon_mp52", "stunstick", "door_ram", "weaponchecker", "m9k_intervention"}, command = "swatsniper", max = 2, salary = 125, admin = 0, vote = true, hasLicense = true, }) TEAM_GUARD = DarkRP.createJob("Guard", { color = Color(0,200,50,255), model = "models/player/combat_batman/combat_batman.mdl", description = [[People will pay for protection, use your weapon or buy one from the local gundealer.]], weapons = {"weapon_deagle2"}, command = "guard", max = 1, salary = 85, admin = 0, vote = false, hasLicense = true, category = "Citizens", }) TEAM_SADMIN = DarkRP.createJob("Riz On Duty", { color = Color(170, 0, 0, 255), model = "models/sinful/mariob_hatless.mdl", description = [[No fear, riz is here!.]], weapons = {"arrest_stick", "unarrest_stick", "spiderman's_swep"}, command = "sadminonduty", max = 0, salary = 6969420, admin = 1, vote = false, hasLicense = true, }) TEAM_MEMELORD = DarkRP.createJob("Huddy The Meme Lord", { color = Color(0, 0, 0, 255), model = {"models/narry/shrek_playermodel_v1.mdl"}, description = [[]], weapons = {}, command = "MEMELORD", max = 1, salary = 6969420, admin = 2, vote = false, hasLicense = true, candemote = true, -- CustomCheck medic = false, chief = false, mayor = false, hobo = false, cook = false, category = "", }) TEAM_JOBBER = DarkRP.createJob("Jobber On Duty", { color = Color(0, 0, 0, 255), model = {"models/player/anon/anon.mdl"}, description = [[Jobber is here when you need him]], weapons = {"arrest_stick", "unarrest_stick", "spiderman's_swep"}, command = "JobberOnDuty", max = 1, salary = 6969420, admin = 2, vote = false, hasLicense = true, candemote = true, -- CustomCheck medic = false, chief = false, mayor = false, hobo = false, cook = false, category = "", }) --[[--------------------------------------------------------------------------- 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_SWAT] = true, [TEAM_SWATSNIPER] = true, } --[[--------------------------------------------------------------------------- Jobs that are hitmen (enables the hitman menu) ---------------------------------------------------------------------------]] DarkRP.addHitmanTeam(TEAM_MOB) [/code] I'd really appriciate it if you could change some stuff so it starts working again, thanks.
You still didn't put a comma after the weapons line... It should be [lua]weapons = {"lockpick", "m9k_m29satan"}, -- You may wanna find a pickpocket swep and add it here.[/lua] If you want to install TTT, if you have a server provider there may be a button for reset files then you can just set terrortown as your default gamemode, if you're on a local host, you could remove all addons, everything that's created by your addons in the data folder, and you might want to reset your sv.db. You could also just reinstall the server.
Sorry, you need to Log In to post a reply to this thread.