Explaination on why the jobs.lua / shipments in darkrpmodification works

I don’t remember the code for DarkRP I’m assuming it was something like this.

AddDarkRPJob
name =
weapons =
color =

something like that idk, (on my phone so I can’t check)
How can I make something like this on my own?
In DarkRP the job gets added into the f4 menu, and everything works vey nice along with the shipments.

What is this called (code wise)? How can I recreate this with anything I want?

Oh look, the Internet, instant access to information

http://wiki.darkrp.com/index.php/DarkRP:CustomJobFields

perhaps I didn’t come off clear. I’m wanting to recreate this system for a different gamemode that makes code very minimal. That’s why I said “recreate” and “How can I make something like this on my own?”

Have a function that creates a team for your job and then adds job table to GAMEMODE.jobs table.

And then this function returns the number of jobs, so you can have ids for jobs

[lua]
GAMEMODE.jobs = {}

function addJob(data)
table.Insert(GAMEMODE.jobs,data)
team.SetUp(args)
return #GAMEMODE.jobs
end

TEAM_MEDIC = addJob(data)

//So you can do:

PrintTable(GAMEMODE.jobs[TEAM_MEDIC])
[/lua]

Humm…Well…You are asking too much :v
This is where you use your knowledges and merge everything, since teams are shared, but you have to do some iterations, vgui and that shit

This is added into the menu through what methods?

Have a derma frame with DListLayout in it. Then add DButtons for each job, which send command to server accordingly.

[editline]11th May 2016[/editline]

Best way to learn is to read source code and wiki.

Thank you to everyone, I appreciate the infomation.

I might be late, but you can take a look at sh_createitems.lua