Client Functions
The following exported functions can be called from any scripts. They should always be called in scripts starting after exp_target_menu.
AddTypeMenuItem
Adds an item to the specified menu type.
exports.exp_target_menu:AddTypeMenuItem({
type = "all",
event = "emotes:OpenEmotesMenu",
desc = "Open Emotes",
stay = false,
arguments = {
favorites = favorite_emotes
}
})
type: string, menu to add the item to. Possible value: all ped vehicle object player in_vehicle (all is actually the personal menu)
event: string, name of the event to call when clicked.
desc: string, text showing on the button.
?stay: boolean, if true the menu stays open when clicked, else it automatically closes.
?arguments: table, arguments passed to the event on trigger.
RemoveTypeMenuItem
Remove the specified item from the menu type.
type: string, menu to remove the item from. Possible value: all ped vehicle object player in_vehicle
event: string, name of the event to call when clicked.
AddEntityMenuItem
Adds an item to the specified entity.
entity: integer, game entity handle to add the item to.
event: string, name of the event to call when clicked.
desc: string, text showing on the button.
?stay: boolean, if true the menu stays open when clicked, else it automatically closes.
?name: string, name of the menu.
?arguments: table, arguments passed to the event on trigger.
RemoveEntityMenuItem
Remove the specified item from the entity.
entity: integer, game entity handle to remove the item from.
event: string, name of the event to call when clicked.
AddModelMenuItem
Adds an item to the specified model.
model: integer, model hash to add the item to.
event: string, name of the event to call when clicked.
desc: string, text showing on the button.
?stay: boolean, if true the menu stays open when clicked, else it automatically closes.
?name: string, name of the menu.
?arguments: table, arguments passed to the event on trigger.
RemoveModelMenuItem
Remove the specified item from the model.
model: integer, model hash to remove the item from.
event: string, name of the event to call when clicked.
Pauses the menu. When paused, the menu can't be opened and the cursor won't appear.
pause: boolean, if true the menu will be paused, else it won't.
Opens the menu with the specified options.
name: string, name to display.
options: table, dictionary with event name as key, and desc and stay as value. (See example)
Sets the menu title for the specified entity.
entity: integer, game entity handle.
name: string, menu title.
Sets the menu title for the specified model.
model: integer, model hash.
name: string, menu title.
Moves the indicator location from the model origin.
model: integer, model hash.
offset: vector3, offset vector to move the indicator from the origin.
When triggered, an event comes with the parameters entity and arguments.
entity: integer, entity handle from whatever entity the interaction was triggered.
arguments: table, arguments passed when the interaction was registered.