> For the complete documentation index, see [llms.txt](https://docs.picklemods.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.picklemods.com/paid-resources/police-job/exports.md).

# Exports

### Server exports

#### Departments

**`GetDepartment(id)`**

Returns the department object for `id`.

```lua
local dept = exports.pickle_policejob:GetDepartment("lspd")
print(dept.label)
```

**`GetDepartmentPermission(id, permission)`**

Returns the value of a named permission on a department.

```lua
local canArrest = exports.pickle_policejob:GetDepartmentPermission("lspd", "arrest")
```

**`GetDepartmentMember(id, source)`**

Returns the department member record for a player.

```lua
local member = exports.pickle_policejob:GetDepartmentMember("lspd", source)
if member then print(member.rank) end
```

**`GetDepartmentRank(id, rankId)`**

Returns the rank object for `rankId` within a department.

```lua
local rank = exports.pickle_policejob:GetDepartmentRank("lspd", "sergeant")
```

**`GetDepartmentEntity(id, entityId)`**

Returns a stored entity (location/asset) for a department.

```lua
local entity = exports.pickle_policejob:GetDepartmentEntity("lspd", "armory_1")
```

**`GetPlayerDepartment(source)`**

Returns the player's current department object.

```lua
local dept = exports.pickle_policejob:GetPlayerDepartment(source)
```

**`GetPlayerDepartmentJob(source)`**

Returns the framework job tied to the player's department.

```lua
local job = exports.pickle_policejob:GetPlayerDepartmentJob(source)
```

**`GetIdentifierDepartment(identifier)`**

Looks up a department by player identifier (offline-safe).

```lua
local dept = exports.pickle_policejob:GetIdentifierDepartment("char1:abc123")
```

**`IsPlayerOnDuty(source)`**

Returns `true` if the player is on duty.

```lua
if exports.pickle_policejob:IsPlayerOnDuty(source) then
    -- on-duty officer logic
end
```

**`SetPlayerDuty(source, onDuty, report)`**

Sets duty state. Pass `report = true` to log to Discord.

```lua
exports.pickle_policejob:SetPlayerDuty(source, true, true)
```

**`IsPlayerDepartmentLeader(source)`**

Returns `true` if the player holds a leader rank.

```lua
if exports.pickle_policejob:IsPlayerDepartmentLeader(source) then
    -- leader-only menu
end
```

**`DoesPlayerHaveEntityPermission(source, id, entityId, onDutyRequired)`**

Permission check against a department entity.

```lua
local allowed = exports.pickle_policejob:DoesPlayerHaveEntityPermission(source, "lspd", "armory_1", true)
```

**`GetTotalCopsOnline()`**

Returns total on-duty officers across all departments.

```lua
local count = exports.pickle_policejob:GetTotalCopsOnline()
if count < 2 then return end -- gate robberies behind a minimum
```

***

#### Department money

**`AddDepartmentMoney(id, amount)`**

Adds funds to a department's balance.

```lua
exports.pickle_policejob:AddDepartmentMoney("lspd", 1000)
```

**`RemoveDepartmentMoney(id, amount)`**

Removes funds from a department's balance.

```lua
exports.pickle_policejob:RemoveDepartmentMoney("lspd", 500)
```

**`GetDepartmentMoney(id)`**

Returns the department's current balance.

```lua
local balance = exports.pickle_policejob:GetDepartmentMoney("lspd")
```

**`AddDepartmentTransaction(id, source, transactionType, amount, reason)`**

Records a transaction against a department.

```lua
exports.pickle_policejob:AddDepartmentTransaction("lspd", source, "expense", 500, "Equipment purchase")
```

***

#### Evidence / files

**`AddEvidence(coords, evidenceType, data)`**

Spawns an evidence record at the given coords.

```lua
exports.pickle_policejob:AddEvidence(vector3(123.4, 567.8, 90.1), "shellcasing", {
    weapon = "WEAPON_PISTOL",
    shooter = "char1:abc123",
})
```

**`CreateFile(source, file)`**

Creates a case file.

```lua
exports.pickle_policejob:CreateFile(source, {
    title = "Robbery on Vinewood",
    content = "<p>Suspect fled north...</p>",
})
```

**`UpdateFile(source, id, file)`**

Updates an existing case file.

```lua
exports.pickle_policejob:UpdateFile(source, fileId, { content = "<p>Updated notes...</p>" })
```

**`DeleteFile(source, id)`**

Deletes a case file.

```lua
exports.pickle_policejob:DeleteFile(source, fileId)
```

***

#### Player forensics / medical

**`GetPlayerEvidence(source, isCreatingFile)`**

Returns aggregated evidence/identifiers for a player.

```lua
local evidence = exports.pickle_policejob:GetPlayerEvidence(source, true)
```

**`GetPlayerDNA(source)`**

Returns the player's DNA record.

```lua
local dna = exports.pickle_policejob:GetPlayerDNA(targetSrc)
```

**`GetPlayerBAC(source)`**

Returns the player's blood alcohol content.

```lua
local bac = exports.pickle_policejob:GetPlayerBAC(targetSrc)
if bac and bac > 0.08 then print("Over the limit") end
```

**`GetPlayerBloodTest(source)`**

Returns the player's blood test result.

```lua
local blood = exports.pickle_policejob:GetPlayerBloodTest(targetSrc)
```

**`GetPlayerGSR(source)`**

Returns the player's gunshot residue result.

```lua
local gsr = exports.pickle_policejob:GetPlayerGSR(targetSrc)
```

***

### Client exports

#### Duty / department state

**`IsPlayerOnDuty()`**

Returns the local player's duty state.

```lua
if not exports.pickle_policejob:IsPlayerOnDuty() then return end
```

**`GetCurrentDepartment()`**

Returns the local player's current department object (or `nil`).

```lua
local dept = exports.pickle_policejob:GetCurrentDepartment()
```

**`GetLocalDepartments()`**

Returns the table of departments synced to this client.

```lua
local departments = exports.pickle_policejob:GetLocalDepartments()
for id, dept in pairs(departments) do print(id, dept.label) end
```

***

#### Actions / handcuffs

**`IsHandcuffed()`**

Returns `true` if the local player is handcuffed.

```lua
if exports.pickle_policejob:IsHandcuffed() then return end
```

**`UncuffPlayer()`**

Uncuffs the local player.

```lua
exports.pickle_policejob:UncuffPlayer()
```


---

# 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:

```
GET https://docs.picklemods.com/paid-resources/police-job/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
