This section guides you through the steps to integrate the Advanced Ped Dialog script with your framework, utilizing built-in functions for seamless integration.
Most of the setup should be understandable, but I'll highlight a few things you might need additional help with. By default, the script is set up for ESX + ox_inventory.
Client Functions
Client functions file can be found at configurations/client/CFunctions.lua .
Inventory
This is designed for convenience, automatically taking item labels from your inventory and using them in buying and selling menus.
fetchItems - toggler to use this feature.
labelVar - variable name in your inventory system.
getAllItems - function that should return all the registered items in your inventory system.
Items table has to be returned as follows:
This function is called only ONCE when a player first time triggers the menu, all the items are saved in cache. Therefore, retrieving your items from the database or server will not cause any issues, as this function is not repeatedly called.
typeGetAllItems= () =>ReturnType;interfaceReturnType { [item_name:string]: {// This will be your label var, it could also be named differently. label:string;// Other item variables. They will not be used, but everything is fine if you don't remove them. [key:string]:unknown; }}
Notifications
Display notifications sent by the script. If you prefer to not show any notifications, you can just leave this function empty.
Text Display
Configure how text is displayed when players approach peds. The functions used depend on your Config.UseEveryTickText setting.
When Config.UseEveryTickText = true:
The script will use this function to display text when player is close to a ped or when player can interact with ped.
When Config.UseEveryTickText = false:
The script will use these functions for the same purpose - showing text when player approaches peds and hiding it when they move away. You will need to implement these functions yourself, but this can be done in your own way.
Example Configuration
Server Functions
Server functions file can be found at configurations/server/SFunctions.lua .