# Server

## GetReputationData

Returns basic reputation stats as a plain table.

```lua
exports["t1ger_chopshop"]:GetPlayerReputation(src)
```

**Parameters**

* `src` *(number)* – The player's server ID.

**Returns**

* `table|nil` – A table with:
  * `points` *(integer)* – Reputation points
  * `parts` *(integer)* – Total parts chopped
  * `scraps` *(integer)* – Total full vehicles scrapped

***

## AddReputationPoints

Adds reputation points to a player and syncs it to their statebag.

```lua
exports["t1ger_chopshop"]:AddReputationPoints(src, amount)
```

**Parameters**

* `src` *(number)* – The player's server ID.
* `amount` *(number)* – The amount of XP to add.

**Returns**

* `boolean` – `true` if successful, `false` otherwise.

***

## RemoveReputationPoints

Removes reputation points from a player (min 0), and syncs to statebag.

```lua
exports["t1ger_chopshop"]:RemoveReputationPoints(src, amount)
```

**Parameters**

* `src` *(number)* – The player's server ID.
* `amount` *(number)* – The amount of XP to remove.

**Returns**

* `boolean` – `true` if successful, `false` otherwise.

***

## SetReputationPoints

Sets a player’s reputation points directly and syncs to statebag.

```lua
exports["t1ger_chopshop"]:SetReputationPoints(src, amount)
```

**Parameters**

* `src` *(number)* – The player's server ID.
* `amount` *(number)* – The amount of XP to remove.

**Returns**

* `boolean` – `true` if successful, `false` otherwise.

***

## GetChopList

Returns the current active Chop List entries.

```lua
exports["t1ger_chopshop"]:GetChopList()
```

**Returns**

* `ChopListEntry[]` – An array of chop list entries with model, hash, quota, and remaining fields.

***

## GetChopListRefreshTime

Returns the remaining time (in seconds) until the next Chop List refresh.

```lua
exports["t1ger_chopshop"]:GetChopListRefreshTime()
```

**Returns**

* `integer` – Seconds remaining until the next chop list update.

{% hint style="info" %}
💡 Divide by 60 and round down if you want minutes.
{% endhint %}

***

## RefreshChopList

Force-refreshes the Chop List immediately. Useful for admin tools, debugging, or manual triggers.

```lua
exports["t1ger_chopshop"]:RefreshChopList()
```

**Returns**

* `void`

***

## CreateBounty

Creates a bounty entry in the database and deducts the reward from the player's cash.\
Only valid, existing vehicles (if a plate is provided) and players with sufficient funds can place a bounty.

```lua
exports["t1ger_chopshop"]:CreateBounty(src, model, plate, reward)
```

**Parameters**

* `src` (`number`) – The server ID of the player placing the bounty.
* `model` (`string`) – The vehicle model name (e.g., `"sultan"`).
* `plate` (`string | nil`) – *(Optional)* Specific license plate to target. If `nil`, any vehicle of the model is valid.
* `reward` (`number`) – The cash reward the player is offering for the bounty.

**Returns**

* `boolean` – `true` if the bounty was created successfully, `false` if validation failed (e.g., invalid model, unowned plate, insufficient funds).

***

## RemoveBounty

Removes an active bounty from the database and optionally refunds the player based on configuration.\
Only valid, unclaimed bounties placed by the requesting player can be removed.

```lua
exports["t1ger_chopshop"]:RemoveBounty(src, bountyId)
```

#### Parameters

* `src` (`number`) – The server ID of the player attempting to remove the bounty.
* `bountyId` (`number`) – The database ID of the bounty to be removed.

#### Returns

* `boolean` – `true` if the bounty was removed successfully, `false` if validation failed (e.g., bounty not found, not owned by player, already completed).

{% hint style="info" %}
Refund amount depends on config:

* `Config.Bounty.RefundOnRemoval = "full"` → full reward refunded.
* `Config.Bounty.RefundOnRemoval = "partial"` → commission deducted (`Config.Bounty.Commission`%).
* `Config.Bounty.RefundOnRemoval = "none"` → no refund.

Only active bounties (`state = 0`) can be removed.
{% endhint %}

***


---

# Agent Instructions: 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.t1ger.net/resources/t1ger-chop-shop/exports/server.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.
