# Lawmen

{% tabs %}
{% tab title="Overview" %}
Introducing the twh\_lawmen script, a comprehensive law enforcement and prison management system for your RedM RP server. This feature-rich script includes a wide range of functionalities, from basic features like custom music and sound effects to advanced police and prison island interactions. Enhance your server's law enforcement experience with twh\_lawmen.

**Key Features:**

1. **Immersive Audio:** Enjoy custom music for cinematics and SoundFX, including codelocks and sirens.
2. **API Control:** Gain full API control for developers to set and get player and prison states.
3. **Advanced Police Interactions:** Handcuff, drag, and transport prisoners with immersive animations and mechanics.
4. **Prison Island Activities:** Engage in mini-games, interact with NPCs, and explore various escape methods.
5. **Lockpick System:** Pick handcuffs and prisoners' wagon locks for a thrilling gameplay experience.
6. **Compatibility:** Works seamlessly with mega\_playerselector for enhanced functionality.
7. **Additional Features:** Experience a wide range of extra features, such as fixed prisoner clothing, custom NPC voice lines, and an opened prison basement.

The twh\_lawmen script delivers an engaging and authentic law enforcement experience for your RedM RP server, offering a multitude of features and functionalities to keep players immersed in their roles. From police interactions to prison island activities, twh\_lawmen ensures a captivating in-game experience. Unleash the full potential of your server's law enforcement with the twh\_lawmen script today!
{% endtab %}

{% tab title="Showcase" %}

#### Showcase-Trailer

{% embed url="<https://youtu.be/pCpfBcIXMpY>" %}
{% endtab %}

{% tab title="API" %}

#### Initialization

```lua
local lawmenAPI = exports['twh_lawmen'].lawmenAPI()
```

#### Usage

```lua
local playerData = lawmenAPI.getPlayerData()
--returns Object Player with Attributes:
        -- .handcuffed (returns true if player is handcuffed)
        -- .IsDragged   (returns true if player is dragged)
        -- .draggedBy (returns player id who drags the player)
        -- .boating (returns true when player is in cinemtic in boat)
        -- .inWagon (returns true when player is in prisoners wagon)
        -- .prisonerClothing (returns true when player wear prisoner clothing)
        -- .playerJob (returns player Job) 

local prisonData = lawmenAPI.getPrisonData()
--returns Object PrisonData with Attributes:
        -- .imprisoned (returns true if player should be imprisoned)
        -- .time  (returns remaining arrest time)
        -- .canEscape (returns true if alert is disabled for player)
```

```lua
--when you want to increase arrest timer
lawmenAPI.increaseArrestTimer(time)

--when you want to decrease arrest timer
lawmenAPI.decreaseArrestTimer(time)

--trigger alert or put it off
lawmenAPI.triggerAlert(state) --true: start alert, false: end alert
```

#### Admin Commands

* reduceArrestTime \[playerID] \[time]
  {% endtab %}

{% tab title="Buy" %}
{% embed url="<https://twh-scripts.tebex.io/package/5378437>" %}
{% endtab %}
{% endtabs %}

## Instruction manual

### Dependencies

Before usage make sure the following dependencies are installed:

* vorp\_inputs
* mega\_playerselector (not required)

### Installation

First execute the sql file which is in the zip folder (Will be changed in the future)

Add following line to your server.cfg or ressource.cfg:

* `ensure twh_lawmen`
