• Jobs not working for some reason.
    1 replies, posted
So, today I decided I was gonna continue progress on my Darkrp script. But, when I went to add jobs, this is the error I get. [CODE][ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:74: '}' expected (to close '{' at line 71) near 'description' 1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0 [/CODE] This makes NO sense, considering that everything is exactly where it should be. It does this to all my custom jobs. Heres my current job file. [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_CITIZEN = DarkRP.createJob("Undecided", { color = Color(0, 0, 0, 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 = [[Undecided.]], weapons = {}, command = "citizen", max = 0, salary = GAMEMODE.Config.normalsalary, admin = 0, vote = false, hasLicense = false, candemote = false }) TEAM_UNSC = DarkRP.createJob("UNSC. Medic", { color = Color(0, 255, 0, 255), model = { "models/jessev92/player/halo/unsc_m01.mdl", "models/jessev92/player/halo/unsc_m02.mdl", "models/jessev92/player/halo/unsc_m03.mdl", "models/jessev92/player/halo/unsc_m04.mdl", "models/jessev92/player/halo/unsc_m05.mdl", "models/jessev92/player/halo/unsc_m06.mdl", "models/jessev92/player/halo/unsc_m07.mdl", "models/jessev92/player/halo/unsc_m08.mdl", "models/jessev92/player/halo/unsc_m09.mdl", "models/jessev92/player/halo/unsc_m11.mdl" }, description = [[A Standard Combat Medic, working for the UNSC. Main objective is to heal wounded soldiers during battle.]], weapons = {"weapon_medkit","h3_magnum_swep"}, command = "unscmedic", max = 3, salary = 100, admin = 0, vote = false, hasLicense = false, candemote = false }) TEAM_UNSC = DarkRP.createJob("UNSC. Pilot", { color = Color(0, 255, 0, 255), model = "models/jessev92/player/halo/odst_pilot.mdl" description = [[A Pilot for the UNSC. Main objective is to round up troops to fly into the heat of battle, as-well as prepare evacs for soldiers in need.]], weapons = {"h3_magnum_swep"}, command = "unscpilot", max = 3, salary = 125, admin = 0, vote = false, hasLicense = false, candemote = false }) /*--------------------------------------------------------------------------- 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, } /*--------------------------------------------------------------------------- Jobs that are hitmen (enables the hitman menu) ---------------------------------------------------------------------------*/ DarkRP.addHitmanTeam(TEAM_MOB)[/CODE] Any ideas? I literally google'd like no other and changed the code mass amounts of times, but continue to get errors with all the jobs besides the Citizen one. Even when I copy the Citizen code, paste it, then edit it accordingly, I still get the same error.
try this: [lua]-- People often copy jobs. When they do, the GM table does not exist anymore. -- This line makes the job code work both inside and outside of gamemode files. -- You should not copy this line into your code. local GAMEMODE = GAMEMODE or GM /*-------------------------------------------------------- Default teams. Please do not edit this file. Please use the darkrpmod addon instead. --------------------------------------------------------*/ TEAM_CITIZEN = DarkRP.createJob("undecided", { color = Color(20, 255, 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 = [[You are the most basic unit of the UNSC. You will fight to keep the Covies out of your base]], weapons = {}, command = "UNSC: MARINE", max = 0, salary = GAMEMODE.Config.normalsalary, admin = 0, vote = false, hasLicense = false, candemote = false, CanPlayerSuicide = function(ply) return false end }) TEAM_UNSC1 = DarkRP.createJob("UNSC Medic", { color = Color(20, 255, 20, 255), model = { "models/jessev92/player/halo/unsc_m01.mdl", "models/jessev92/player/halo/unsc_m02.mdl", "models/jessev92/player/halo/unsc_m03.mdl", "models/jessev92/player/halo/unsc_m04.mdl", "models/jessev92/player/halo/unsc_m05.mdl", "models/jessev92/player/halo/unsc_m06.mdl", "models/jessev92/player/halo/unsc_m07.mdl", "models/jessev92/player/halo/unsc_m08.mdl", "models/jessev92/player/halo/unsc_m09.mdl", "models/jessev92/player/halo/unsc_m11.mdl" }, description = [[A Standard Combat Medic, working for the UNSC. Main objective is to heal wounded soldiers during battle.]], weapons = {"h3_magnum_swep", "weapon_medkit"}, command = "unscmedic", max = 3, salary = 100, admin = 0, vote = false, hasLicense = false, candemote = false, CanPlayerSuicide = function(ply) return false end }) TEAM_UNSC2 = DarkRP.createJob("UNSC Pilot", { color = Color(20, 255, 20, 255), model = { models/jessev92/player/halo/odst_pilot.mdl }, description = [[A Pilot for the UNSC. Main objective is to round up troops to fly into the heat of battle, as-well as prepare evacs for soldiers in need.]], weapons = {"h3_magnum_swep"}, command = "unscpilot", max = 3, salary = 125, admin = 0, vote = false, hasLicense = false, candemote = false, CanPlayerSuicide = function(ply) return false end }) -- Compatibility for when default teams are disabled TEAM_CITIZEN = TEAM_CITIZEN or -1 TEAM_POLICE = TEAM_POLICE or -1 TEAM_GANG = TEAM_GANG or -1 TEAM_MOB = TEAM_MOB or -1 TEAM_GUN = TEAM_GUN or -1 TEAM_MEDIC = TEAM_MEDIC or -1 TEAM_CHIEF = TEAM_CHIEF or -1 TEAM_MAYOR = TEAM_MAYOR or -1 TEAM_HOBO = TEAM_HOBO or -1 /* -------------------------------------------------------- HOW TO MAKE A DOOR GROUP -------------------------------------------------------- AddDoorGroup("NAME OF THE GROUP HERE, you see this when looking at a door", Team1, Team2, team3, team4, etc.) The default door groups, can also be used as examples: */ AddDoorGroup("UNSC only", TEAM_UNSC1, TEAM_UNSC2) AddDoorGroup("Gundealer only", TEAM_GUN) /* -------------------------------------------------------- HOW TO MAKE AN AGENDA -------------------------------------------------------- AddAgenda(Title of the agenda, Manager (who edits it), Listeners (the ones who just see and follow the agenda)) The default agenda's, can also be used as examples: */ AddAgenda("Gangster's agenda", TEAM_MOB, {TEAM_GANG}) AddAgenda("Police agenda", TEAM_MAYOR, {TEAM_CHIEF, TEAM_POLICE, TEAM_SWAT, TEAM_SWATLEADER, TEAM_POLICEP, TEAM_DPOLICE}) /* --------------------------------------------------------------------------- HOW TO MAKE A GROUP CHAT --------------------------------------------------------------------------- Pick one! GAMEMODE:AddGroupChat(List of team variables separated by comma) or GAMEMODE:AddGroupChat(a function with ply as argument that returns whether a random player is in one chat group) This one is for people who know how to script Lua. */ GAMEMODE:AddGroupChat(function(ply) return ply:isCP() end) GAMEMODE:AddGroupChat(TEAM_MOB, TEAM_GANG) /*--------------------------------------------------------------------------- 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 = {} /*--------------------------------------------------------------------------- Enable hitman goodies on this team ---------------------------------------------------------------------------*/ DarkRP.addHitmanTeam() /*--------------------------------------------------------------------------- Default demote groups ---------------------------------------------------------------------------*/ DarkRP.createDemoteGroup("Cops", {TEAM_POLICE, TEAM_CHIEF}) DarkRP.createDemoteGroup("Gangsters", {TEAM_GANG, TEAM_MOB}) [/lua] [editline]31st October 2014[/editline] replace the whole document with this
Sorry, you need to Log In to post a reply to this thread.