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.UseInventorySearch
This 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)
end
Here you have to integrate the server sided trigger of your notify for players to recive notifications
Config.ShowNotifyToSearchedPlayer = true
Should teh searched player get a notify while he is searched?
Config.ShowNameInMenuTit = true
Should the menu_default title show the players name?
Config.UseProgressBar = false
If you want to integrate a progressbar for searching. If true you have to configure Config.ProgressWaitTime
& Config.InitProgressBar
below.
Config.ProgressWaitTime = 3000
Here you cant set how long the inventory search is delayed and its should match the progress bar´s time.
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.
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.
Last updated