Utils
If you use ESX, the X Menu has some integrated features that may be usefuel for you
Search inventory
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.
Config.UseInventorySearchThis determits if you event want to use the search feature
Config.SearchRange = 3.0 This determits how far away the player can be to be searched
Config.FoundMenuAligin = 'middle-left'This determits how the esx_menu_default should be aligned
Config.ItemCountColor = "red" This determits what color the item count of the players itms has. It supports alle html color names & hex codes
function ServerNotifyXMenu(title, text, nftype, target)
endHere you have to integrate the server sided trigger of your notify for players to recive notifications
Config.ShowNotifyToSearchedPlayer = trueShould teh searched player get a notify while he is searched?
Config.ShowNameInMenuTit = trueShould the menu_default title show the players name?
Config.UseProgressBar = falseIf you want to integrate a progressbar for searching. If true you have to configure Config.ProgressWaitTime & Config.InitProgressBar below.
Config.ProgressWaitTime = 3000Here you cant set how long the inventory search is delayed and its should match the progress bar´s time.
Config.InitProgressBar = function ()
endHere you can start your pogress bar which should last als long as the Config.ProgressWaitTime and also add a animation if you want.
function ExploitSearchFunction(playerId)
endThis 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.
Last updated