# Utils

If you use ESX, the X Menu has some integrated features that may be usefuel for you

## Search inventory

{% hint style="info" %}
**Dependencies:**

* es\_extended
* esx\_menu\_default
  {% endhint %}

With the serach function you can search a players ineventory and display their items in menu\_default without the ability to steal them.  This feature is complytly exploit save, if a hacker trys to abuse the trigger and seraches a player more away than the initial open distance, then he gets banned.

### Configuration

The configuration for the search feature you will find on line 410 to 464 of config.lua.

```lua
Config.UseInventorySearch
```

This determits if you event want to use the search feature

```lua
Config.SearchRange = 3.0 
```

This determits how far away the player can be to be searched

```lua
Config.FoundMenuAligin = 'middle-left'
```

This determits how the esx\_menu\_default should be aligned

```lua
Config.ItemCountColor = "red"  
```

This determits what color the item count of the players itms has. It supports alle html color names & hex codes

```lua
function ServerNotifyXMenu(title, text, nftype, target)
    
end
```

Here you have to integrate the server sided trigger of your notify for players to recive notifications

```lua
Config.ShowNotifyToSearchedPlayer = true
```

Should teh searched player get a notify while he is searched?

```lua
Config.ShowNameInMenuTit = true
```

Should the menu\_default title show the players name?

```lua
Config.UseProgressBar = false
```

If you want to integrate  a progressbar for searching. If true you have to configure `Config.ProgressWaitTime` & `Config.InitProgressBar` below.

```lua
Config.ProgressWaitTime = 3000
```

Here you cant set how long the inventory search is delayed and its should match the progress bar´s time.

```lua
Config.InitProgressBar = function ()

end
```

Here you can start your pogress bar which should last als long as the `Config.ProgressWaitTime`  and also add a animation if you want.

```lua
function ExploitSearchFunction(playerId)

end
```

This function gets called if a hacker trys to exploit the trigger and trys to serach a player out of range with it. Here you can integrate you ban trigger.
