> For the complete documentation index, see [llms.txt](https://maxifaxipaxi-1.gitbook.io/mfpscripts-fivem-discontinued/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maxifaxipaxi-1.gitbook.io/mfpscripts-fivem-discontinued/scripts/policejob/developers.md).

# Developers

## Exports

### Server Exports

Get the amout of weapons available at the LSPD:

```lua
-- 'weapon' is a String and uppercase
-- 'amount' is an Interger
local amount = exports['mfp_policejob']:getWeaponStock(weapon)
```

Get the mileage:

```lua
-- 'plate' is a String
-- 'amount' is an Interger
local amount = exports['mfp_policejob']:GetCarMileage(plate)
```

Handcuff a player / uncuff a player:

```lua
-- 'canmove' true to make moveable, false to freeze
-- 'target' is the target
exports['mfp_policejob']:Handcuff(target, canmove)
```

Get Vehicleinformation

```lua
-- 'plate' is a String
-- vehinfo.registered (bool): true/false
-- vehinfo.first_registration (String): date as a string
-- vehinfo.owner (String): First & Lastname
local vehinfo = exports['mfp_policejob']:getVehicleInfos(plate)
```

Get Playerdata with licences, weapons, inventory, money

```lua
-- data.firstname: Firstname (String)
-- data.name: Lastname (String)
-- data.job: Job Label (String)
-- data.grade: JobGrade Label (String)
-- data.inventory: Invetory (Array)
-- data.accounts: MoneyAccount (Array)
-- data.weapons: Weapons (Array)
-- data.dob: Date (String)
-- data.height: Heigth (String)
-- data.sex: 'm' or 'f'
-- data.licenses: Licenses (Array)
    
-- 'target' is the target-id
local data = exports['mfp_policejob']:getVehicleInfos(target)
```

### Client Exports

Open the F6 Interaction menu

```lua
exports['mfp_policejob']:openInteractionMenu()
```

Open the Police Wardrope

```lua
exports['mfp_policejob']:openWardrobeMenu()
```

Set the uniform of an officer

```lua
-- 'playerPed' is the playerpedid
-- 'grade' is the grade of the preset of clothings (Int)
-- 'hasvest' is the clothing containing a bulletproofvest (bool)
exports['mfp_policejob']:SetUniform(grade, playerPed, hasvest)
```

Trigger the activation of ur own panicbutton

```lua
exports['mfp_policejob']:triggerPanicButton()
```

### Customize Weapons at Armory

add the following lines at client/client.lua:383

<pre class="language-lua"><code class="lang-lua"><strong>-- replace MY WEAPONNAME with the label of your weapon
</strong><strong>-- replace WEAPON_MYWEAPON with your weaponspawnname
</strong><strong>local customitem = NativeUI.CreateItem("MY WEAPONNAME",'') 
</strong>mainMenu:AddItem(customitem )

ESX.TriggerServerCallback('mfp_policejob_waffenkammer:getStock', function(stock)
    customitem:RightLabel('~p~'..stock)
end, 'WEAPON_MYWEAPON')
    
customitem.Activated = function(sender, index)
	TriggerServerEvent('mfp_policejob_waffenkammer:reinraus', 'WEAPON_MYWEAPON', "MY WEAPONNAME")
        _menuPool:CloseAllMenus()
end
</code></pre>

import the following sql-statement:

```sql
INSERT INTO mfp_stocks (typ, amount) VALUES ('WEAPON_MYWEAPON', 4);
```

Thats it, you are good to go! 👍


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://maxifaxipaxi-1.gitbook.io/mfpscripts-fivem-discontinued/scripts/policejob/developers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
