Categories not working

I am getting errors for all my jobs saying there is not categories for them. I recoded all of them and im still getting the same error listed below.
[ERROR] A runtime error has occurred in “your jobs” on line -1.
The best help I can give you is this:

The category of “Commander Axer” (“Medics”) does not exist!

Hints:

  • Make sure the category is created with DarkRP.createCategory.
  • The category name is case sensitive!
  • Categories must be created before DarkRP finished loading.

The responsibility for the error above lies with (the authors of) one (or more) of these files:
your jobs
------- End of Simplerr error ------

I am using darkrpmodification with the darkrp gamemode. Under categories.lua ive put all my job categories went over them numerous times.
The server host support went over them and could not see what I did wrong and told me to post here.

It would really help if you posted the code and not expected us to pull a solution out of our asses :slight_smile:

–[[-----------------------------------------------------------------------
Categories

The categories of the default F4 menu.

Please read this page for more information:
http://wiki.darkrp.com/index.php/DarkRP:Categories

In case that page can’t be reached, here’s an example with explanation:

DarkRP.createCategory{
name = “Citizens”, – The name of the category.
categorises = “jobs”, – What it categorises. MUST be one of “jobs”, “entities”, “shipments”, “weapons”, “vehicles”, “ammo”.
startExpanded = true, – Whether the category is expanded when you open the F4 menu.
color = Color(0, 107, 0, 255), – The color of the category header.
canSee = function(ply) return true end, – OPTIONAL: whether the player can see this category AND EVERYTHING IN IT.
sortOrder = 100, – OPTIONAL: With this you can decide where your category is. Low numbers to put it on top, high numbers to put it on the bottom. It’s 100 by default.
}

Add new categories under the next line!
---------------------------------------------------------------------------]]
DarkRP.createCategory{
name = “STAFF”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 122,
}

DarkRP.createCategory{
name = “Extra”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 121,
}

DarkRP.createCategory{
name = “Jedi”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 224, 255, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 120,
}

DarkRP.createCategory{
name = “EVENT”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 119,
}

DarkRP.createCategory{
name = “CLONE COMMANDOS”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 118,
}

DarkRP.createCategory{
name = “WolfPack”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 117,
}

DarkRP.createCategory{
name = “BEAR”,
categorises = “jobs”,
startExpanded = true,
color = Color(181, 100, 6, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 116,
}

DarkRP.createCategory{
name = “Shadow Troopers”,
categorises = “jobs”,
startExpanded = true,
color = Color(86, 39, 39, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 115,
}

DarkRP.createCategory{
name = “212th”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 173, 16, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 114,
}

DarkRP.createCategory{
name = “327th”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 173, 16, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 113,
}

DarkRP.createCategory{
name = “ARC”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 173, 16, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 112,
}

DarkRP.createCategory{
name = “Shock Company”,
categorises = “jobs”,
startExpanded = true,
color = Color(198, 20, 20, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 111,
}

DarkRP.createCategory{
name = “Green Company”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 173, 16, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 110,
}

DarkRP.createCategory{
name = “Medics”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 0, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 109,
}

DarkRP.createCategory{
name = “Flight Squad 7”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 244, 0, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 108,
}

DarkRP.createCategory{
name = “Talon Squad”,
categorises = “jobs”,
startExpanded = true,
color = Color(15, 127, 13, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 107,
}

DarkRP.createCategory{
name = “41ST Elite”,
categorises = “jobs”,
startExpanded = true,
color = Color(108, 108, 122, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 106,
}

DarkRP.createCategory{
name = “Senate”,
categorises = “jobs”,
startExpanded = true,
color = Color(0, 7, 178, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 105,
}

DarkRP.createCategory{
name = “Galactic Marines”,
categorises = “jobs”,
startExpanded = true,
color = Color(160, 32, 63, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 104,
}

DarkRP.createCategory{
name = “5TH Fleet”,
categorises = “jobs”,
startExpanded = true,
color = Color(31, 152, 204, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 103,
}

DarkRP.createCategory{
name = “501st Legion”,
categorises = “jobs”,
startExpanded = true,
color = Color(51, 102, 201, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 102,
}

DarkRP.createCategory{
name = “187th Legion”,
categorises = “jobs”,
startExpanded = true,
color = Color(204, 0, 255, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 101,
}

DarkRP.createCategory{
name = “Clones”,
categorises = “jobs”,
startExpanded = true,
color = Color(255, 255, 255, 255),
canSee = function(ply) return table.HasValue({}, ply:GetNWString(“usergroup”)) end,
sortOrder = 100,
}

Upload your categories file so we can take a look, it can be one of a thousand missed commas.

Edit: Oh you just pasted it while I was typing my comment…one moment ill look it over.

:snip:

https://codeshare.io/w56YR

First thing I notice (unrelated to syntax) was your questionable use of this function:



canSee = function(ply) 
    return table.HasValue({}, ply:GetNWString("usergroup")) 
end


Not sure why you need to return false on every category

Other question now is are there any errors being thrown by the file your categories are in? Is it even being loaded? Aside from syntax there could be multiple things going on here

[editline]30th April 2016[/editline]

Also, did you edit anything else, in particular any core gamemode files?

It says that the category names are case sensitive, Are you sure you want the name as “Medics” instead of “Commander Axer” ? just a quick jab, last darkrp I used was 2.4 I think so im not current with this versions specifics.

Timz: I just assumed he will add values to the tables later once this is working, your making me doubt if this would error now lol.

Commander Axer is the job name

I only edited darkrpcustomthings in jobs and categories that’s it

[editline]30th April 2016[/editline]

as for the other question I used thecodingbeast for the categories which is why it has that function

That function is checking to see if the player’s usergroup exists in an empty table btw

Are there any errors thrown in your “jobs file” before simplerr spit out whatever it did about your categories? If those two files are the only files you touched I have a suspicion that the problem could lie in the jobs file before the Commander Axer job was created

Ah sorry I understand now. Well if your getting the error you stated…perhaps there is nothing wrong with your categories, but instead something with the specific Commander Axer job? Maybe you’ve misspelled something when adding the job to the category? Are you sure the job “Command Axer” is being added to the category “Medics”?

ill post the console here https://codeshare.io/tXV0r

[editline]30th April 2016[/editline]

TEAM_COMMANDERAXER = DarkRP.createJob(“Commander Axer”, {
color = Color(255, 0, 0, 255),
model = {“models/player/asgclonewars/trooper_officer/clonetrooper_officer.mdl”},
description = [[Medic Commander in control of the med bay and combat medics.]],
weapons = {weapon_752_dc15a, weapon_752_dc15sa, weapon_fists, weapon_plasmanade, weapon_752_ihr, weapon_medkit},
command = “axer”,
max = 1,
salary = 100,
admin = 0,
vote = false,
hasLicense = true,
candemote = false,
category = “Medics”,
})

ctrl+f for “error.” You have a lot of 'em.

What do you mean?

Upload your teams file please. I’ve found before that its common that an error will happen before or after the class that the error is called for. So perhaps the team before TEAM_COMMANDERAXER has something messed up…

https://codeshare.io/tXV0r jobs

[editline]30th April 2016[/editline]

that’s wats in the jobs.lua folder

[editline]30th April 2016[/editline]

so anyone have a solution for this?

Hm I don’t see anything that stands out in your jobs.lua. Could you post your console again? The link is now cleared and I didn’t get a chance to check it out.

ya give me a second

[editline]30th April 2016[/editline]

ok its the same link

[editline]30th April 2016[/editline]

find anything

Still not showing anything for me, idk. Try a new link?