DarkRP GAMEMODE.DefaultTeam does not work

In jobs.lua, GAMEMODE.DefaultTeam does not work if Citizen = true in disabled_defaults.lua.

If I set Citizen to false in disabled_defaults.lua, GAMEMODE.DefaultTeam does not work. When I join, I get put in a class with no name.

Is GAMEMODE.DefaultTeam set to TEAM_CITIZEN?

Yes.

Which one is it? False or true?

True, sorry for the edit.

So you’re disabling the citizen job which means GAMEMODE.DefaultTeam cannot find the job. Change GAMEMODE.DefaultTeam to some job that exists.

Or are you replacing the citizen job with a custom one?

I am replacing the citizen job with a custom citizen job set to TEAM_CITIZEN.

Also I have a mayor script so when the mayor dies he is demoted to the default class, when he dies it just stays as mayor.

Make sure you are creating the jobs before setting the DefaultTeam.

I already have the job created. Also I tried to set the defaultjob to hobo which i also created custom and there was no change.

I meant in the file. So it should be like this:

[lua]
TEAM_CITIZEN = DarkRP.createJob(…

// later in file…

GAMEMODE.DefaultTeam = TEAM_CITIZEN
[/lua]

Rather than the other way round.

My jobs.lua: http://pastebin.com/7KfsPN7S

Should be okay. I’ll just check myself just now.

The GAMEMODE.DefaultTeam is set to TEAM_HOBO in that but that is from testing it a minute ago.

Could you post your disabled_defaults.lua too?

Disabled_defaults.lua: http://pastebin.com/RNMMHDme

Yeah this seems to be bugged, if you set the default to a job that was in defaults and is disabled, it seems to do that. Your best call is to either make a different name for it (TEAM_CITIZENS or like that), or just leave the default citizen as is.

I did the TEAM_CITIZENS thing and it immeaditly kicked me for a lua error.


 [ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:134: attempt to index field 'Config' (a nil value)
  1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:134
   2. include - [C]:-1
    3. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:112
     4. v - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:120
      5. Call - lua/includes/modules/hook.lua:82
       6. unknown - lua/includes/modules/gamemode.lua:40
        7. DeriveGamemode - [C]:-1
         8. unknown - gamemodes/darkrp/gamemode/cl_init.lua:5

I’m assuming the best thing to do would be just to use the default citizen…

[editline]31st January 2014[/editline]

Okay I managed to stop the lua errors, I think they were unrelated. But I am having the same issue even when it is set to CITIZENS (or anything else). So I think I am just going to have to settle for the default salary. Thanks for your help everyone!