> For the complete documentation index, see [llms.txt](https://igris-script.gitbook.io/igris-script/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://igris-script.gitbook.io/igris-script/free-script/igris-search.md).

# Igris Search

<figure><img src="https://2862342791-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFnkzyjlqOP6UGw1GyN62%2Fuploads%2Fkd2ytLof9y2w1FA5Zioc%2Fsearch.png?alt=media&amp;token=65524548-fb93-47f3-9bd9-81b83b6e54ff" alt=""><figcaption></figcaption></figure>

igris\_search (v1.0.1) lets players search another player who is handcuffed, hogtied or dead, then take their cash, gold, items or weapons. Every action can be limited to certain jobs and logged to Discord.

| Requirement         | Status   | Notes                                                |
| ------------------- | -------- | ---------------------------------------------------- |
| RedM server         | Required |                                                      |
| vorp\_core          | Required | Characters, money, gold, notifications, webhooks     |
| vorp\_inventory     | Required | Recent version with the `openPlayerInventory` export |
| vorp\_menu          | Required | Search menu and amount input                         |
| Discord webhook URL | Optional | Search logs                                          |

No database changes and no items are needed. `config.lua` is left open (escrow\_ignore), so every setting and text can be edited. The rest of the code is protected by Tebex escrow.

### Installation

Installation takes about two minutes: no SQL and no items, just the folder, the config and one `ensure` line.

1. Download the resource from your Tebex / CFX Portal account (Keymaster → Granted Assets).
2. Place the `igris_search` folder in your `resources` directory.
3. Open `config.lua`:
4. Choose who can be searched (`handcuff`, `hogtie`, `isDead`).
5. Choose what can be taken (`stealcash`, `stealgold`, `stealitems`, `stealguns`).
6. Set your law jobs in `Config.jobs`.
7. Paste your Discord webhook in `Config.adminwebhooklink`, or set `Config.webhook = false`.
8. Translate `Config.language` if your server is not French (see Configuration reference).
9. Add the resource to your `server.cfg` after its dependencies:

```
ensure vorp_core
ensure vorp_inventory
ensure vorp_menu
ensure igris_search
```

5. Restart the server. The console prints `Script crée par Igris` when the resource starts.
6. Test with two players: handcuff or hogtie one, stand next to them and press G.

### Gameplay

A search starts with G next to a restrained player and ends as soon as either player moves away.

1. Stand within 1 m of a player who is handcuffed, hogtied or dead (depending on the config), on foot.
2. Press **G**: the searcher crouches, and the target is told they are being searched.
3. The search menu shows the target's cash, gold and an Inventory button, depending on what can be stolen.
4. **Cash / Gold**: type an amount; it is moved from the target to the searcher, and the menu closes.
5. **Inventory**: opens the target's VORP inventory. Items and weapons can be dragged out if allowed, otherwise they are view-only.

Built-in protections:

* Only one player can search a given character at a time.
* The server checks that both players are within 3 m before every action, and that the amount is not more than the target owns.
* The search closes when the players move apart (more than 1.8 m), or when the searcher is cuffed, hogtied or dies.
* Restrained players cannot open their own inventory.
* Jobs in `Config.norobjob` can never be searched, and blacklisted items and weapons can never be taken.

### Configuration reference

All settings are in `config.lua`. The `steal*` options apply to everyone; the `bypass*` options give the same right only to jobs in `Config.jobs`.

#### Who can be searched

| Setting         | Default | What it does                                              |
| --------------- | ------- | --------------------------------------------------------- |
| Config.handcuff | `true`  | Handcuffed players can be searched                        |
| Config.hogtie   | `true`  | Hogtied players can be searched                           |
| Config.isDead   | `false` | Dead players can be searched                              |
| Config.norobjob | `{}`    | Jobs that can never be searched, for example `{"doctor"}` |

#### Jobs

| Setting            | Default                 | What it does                                                    |
| ------------------ | ----------------------- | --------------------------------------------------------------- |
| Config.jobs        | `{"police", "marshal"}` | Jobs used by the three settings below and by the bypass options |
| Config.jobonly     | `false`                 | Only these jobs can search                                      |
| Config.jobonlytake | `false`                 | Only these jobs can take cash and gold; others can only look    |

#### What can be taken

| Setting           | Default | Bypass for Config.jobs | Default |
| ----------------- | ------- | ---------------------- | ------- |
| Config.stealcash  | `true`  | Config.bypasscash      | `false` |
| Config.stealgold  | `false` | Config.bypassgold      | `false` |
| Config.stealitems | `true`  | Config.bypassitems     | `false` |
| Config.stealguns  | `true`  | Config.bypassguns      | `false` |

Example: to let only lawmen seize weapons, set `stealguns = false` and `bypassguns = true`.

#### Blacklists

```lua
Config.blacklisteditems = { "bountylicns" }   -- items that can never be taken
Config.blacklistedweapons = { "WEAPON_REVOLVER_CATTLEMAN" }  -- weapons that can never be taken
```

#### Discord logs

| Setting                 | Default         | What it does              |
| ----------------------- | --------------- | ------------------------- |
| Config.webhook          | `true`          | Turns logs on or off      |
| Config.adminwebhooklink | `"url_webhook"` | Discord webhook URL       |
| Config.webhookavater    | `""`            | Optional avatar image URL |

Logs include who searched whom, cash and gold taken, and inventory openings.

#### Texts

Every player-facing text is in `Config.language` and is in French by default. Replace the values to translate, for example `search = "Search"`, `takecash = "Take cash"`, `beingsearched = "Someone is searching you"`.

#### Not used in this version

`Config.metadata`, `Config.useDecayitems`, `Config.newcharactersafetimer` and `Config.dutycheck` are present in the file but have no effect yet. Leave them as they are.

### Troubleshooting

| Problem                                  | Fix                                                                                                         |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| No "Search" prompt                       | The target must be handcuffed, hogtied or dead as allowed in the config, and you must be on foot within 1 m |
| Prompt never shows for some players      | `Config.jobonly = true` and their job is not in `Config.jobs` (job names are case-sensitive)                |
| "You cannot search this job"             | The target's job is in `Config.norobjob`                                                                    |
| Menu shows no cash or gold line          | `stealcash` / `stealgold` is `false` and the searcher has no bypass                                         |
| Cash or gold cannot be taken             | `Config.jobonlytake = true` and the searcher's job is not in `Config.jobs`                                  |
| Inventory opens but nothing can be taken | `stealitems` / `stealguns` are off for this player, or the item is blacklisted                              |
| Inventory does not open                  | Update vorp\_inventory to a version with the `openPlayerInventory` export                                   |
| Search closes by itself                  | The players moved more than 1.8 m apart, or the searcher was restrained                                     |
| No Discord logs                          | `Config.webhook = true` and a valid URL instead of `url_webhook`                                            |

Still stuck? Open a ticket on our Discord with your server and F8 console logs.
