FPtje/DarkRP — pull request #810 by Bo98 (2013-07-16 14:39:28+00:00)
Title: Job enhancements - avoids hardcoded jobs in core files, removes dependencies on default jobs.

Quite a large pull request but it is something that I've wanted to see in DarkRP for a while. A lot of the core files contain references to the default jobs. This blocks a lot of customisability and creates bugs. A very simple example is the /cr command. This was only receivable by TEAM_POLICE and TEAM_CHIEF. Any custom CP job would not work with this command. A majority of this pull request however is adding job fields which gives the team permissions to special features. An example for this is the /buyfood command. This previously was only available for the Cook without removing the command and coding your own. Now there's a job field which defines which jobs have permission to the cook features (which is currently only /buyfood - I made it so the microwave is handled through AddEntity's allowed field). I also added a GM.DefaultTeam, removing DarkRP's dependency on TEAM_CITIZEN.

An in depth overview:
* Added GM.DefaultTeam. This is used to specify which team joining players should spawn into and what team you change to when demoted.
* Added the 'mayor' job field. This defines what jobs have access to the mayor features. This includes the interaction with law boards, lottery and lockdowns. (@Neosinos)
* Added the 'chief' job field. This defines what jobs have access to the chief features. This includes working with jail positions (if the config is set).
* Added the 'medic' job field. Only use so far is the /buyhealth command (only medics can use it if there is a medic - otherwise everyone can).
* Added the 'cook' job field. This defines what jobs have access to /buyfood.
* Added the 'hobo' job field. This is for the poop throwing and zombie sounds. Main point of this is to remove the dependency on TEAM_HOBO.
* Added the 'mayorCanSetSalary' field. Before it was messy. Only certain jobs that were hardcoded into main.lua could have their salary set by the mayor. This fixes the problem where all custom jobs could not have their salary set. This defaults to false. CPs are true regardless (tell me if you want this changed). Mayors are false regardless.
* Made better use of an entity's allowed field. Microwaves and gun labs now work for whatever jobs you set in the entity's allowed field.
* Replaced calls to CP teams with IsCP(). This fixes an issue where /cr only worked for the default CP jobs.

One thing I have not touched is the F4 menu. You are recoding it so there is no point putting the effort into that when it'll all be different in the coming days/weeks.