DarkRP:SettingCPTeams

From Official DarkRP Wiki
Jump to: navigation, search


This page is available in the following languages:
Данная версия страницы доступна на следующих языках:
Jarvis-flag 8010.png English | Russia-flag.png Русский | France-flag.png Français

When you create your own jobs, you might want to tell DarkRP that some jobs are part of the Civil Protection force. One example is the SWAT job. SWATs are police officers too, so they should be able to warrant, make people wanted and do other Civil Protection related stuff.

The CP settings

If you look closely in lua/darkrp_customthings/jobs.lua (see here), you will find this:

GAMEMODE.CivilProtection = {
	[TEAM_POLICE] = true,
	[TEAM_CHIEF] = true,
	[TEAM_MAYOR] = true,
}

This is the default police force.

How to add a job to the Civil Protection force

Say you have a SWAT team, which you call TEAM_SWAT in jobs.lua:

TEAM_SWAT = DarkRP.createJob("SWAT", ... Blah blah blah

Adding your SWAT team to the police force is easy, just add it to the CivilProtection thing in jobs.lua:

GAMEMODE.CivilProtection = {
	[TEAM_POLICE] = true,
	[TEAM_CHIEF] = true,
	[TEAM_MAYOR] = true,
	[TEAM_SWAT] = true,
}

That's it!