ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]
:toc: left
:toclevels: 5

= Police

This module adds some police features.

== Extension

=== User

[source,lua]
----
self.police_records -- list of strings

-- insert a police record (will do a save)
--- record: text for one line (html)
User:insertPoliceRecord(record)

User:savePoliceRecords()
----

=== Server

[source,lua]
----
self.cfg
self.wantedlvl_users -- map of user => wanted level

Police:getUserWantedLevel(user)
----

=== Client

[source,lua]
----
self.handcuffed -- flag
self.cop -- flag
self.wanted_level
self.current_jail
self.follow_player

-- set player as cop (true or false)
Police:setCop(flag)

-- HANDCUFF

Police:toggleHandcuff()

Police:setHandcuffed(flag)

Police:isHandcuffed()

Police:putInNearestVehicleAsPassenger(radius)

-- FOLLOW

-- follow another player
-- player: nil to disable
Police:followPlayer(player)

-- return player or nil if not following anyone
Police:getFollowedPlayer()

-- JAIL

-- jail the player in a no-top no-bottom cylinder 
Police:jail(x,y,z,radius)

-- unjail the player
Police:unjail()

Police:isJailed()

-- WANTED

Police:applyWantedLevel(new_wanted)

-- TUNNEL

Police.tunnel.setCop = Police.setCop
Police.tunnel.toggleHandcuff = Police.toggleHandcuff
Police.tunnel.setHandcuffed = Police.setHandcuffed
Police.tunnel.isHandcuffed = Police.isHandcuffed
Police.tunnel.putInNearestVehicleAsPassenger = Police.putInNearestVehicleAsPassenger
Police.tunnel.followPlayer = Police.followPlayer
Police.tunnel.getFollowedPlayer = Police.getFollowedPlayer
Police.tunnel.jail = Police.jail
Police.tunnel.unjail = Police.unjail
Police.tunnel.isJailed = Police.isJailed
Police.tunnel.applyWantedLevel = Police.applyWantedLevel
----

== Menu

=== police

Police menu.

=== police.fine

Police fine sub-menu.

.data
[horizontal]
tuser:: target user
money:: target maximum available money

=== police.check

Police check report menu.

.data
[horizontal]
tuser:: target user

=== police_pc

Police PC menu.

=== police_pc.records

Police PC records sub-menu. Manage police records of a character.

.data
[horizontal]
tuser:: target user

== Item

=== bulletproof_vest

Bulletproof vest, set maximum armour when used.
