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.
Example
exports.exp_target_menu:AddTypeMenuItem({
type = "all",
event = "emotes:OpenEmotesMenu",
desc = "Open Emotes",
stay = false,
arguments = {
favorites = favorite_emotes
}
})Options
type: string, menu to add the item to. Possible value:allpedvehicleobjectplayerin_vehicle(allis actually the personal menu)event: string, name of the event to call when clicked.desc: string, text showing on the button.?
stay: boolean, iftruethe 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.
Example
Options
type: string, menu to remove the item from. Possible value:allpedvehicleobjectplayerin_vehicleevent: string, name of the event to call when clicked.
AddEntityMenuItem
Adds an item to the specified entity.
Example
Options
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, iftruethe 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.
Example
Options
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.
Example
Options
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, iftruethe menu stays open when clicked, else it automatically closes.?
name: string, name of the menu.?
arguments: table, arguments passed to the event on trigger.?
offset: vector3, indicator's offset for this model. (This offset will overwrite the last one)
RemoveModelMenuItem
Remove the specified item from the model.
Example
Options
model: integer, model hash to remove the item from.event: string, name of the event to call when clicked.
PauseMenu
Pauses the menu. When paused, the menu can't be opened and the cursor won't appear.
Options
pause: boolean, iftruethe menu will be paused, else it won't.
OpenMainMenu
Opens the menu with the specified options.
Options
name: string, name to display.options: table, dictionary with event name as key, and desc and stay as value. (See example)
SetEntityName
Sets the menu title for the specified entity.
Options
entity: integer, game entity handle.name: string, menu title.
SetModelName
Sets the menu title for the specified model.
Options
model: integer, model hash.name: string, menu title.
SetModelOffset
Moves the indicator location from the model origin.
Options
model: integer, model hash.offset: vector3, offset vector to move the indicator from the origin.
Response
When triggered, an event comes with the parameters entity and arguments.
Parameters
entity: integer, entity handle from whatever entity the interaction was triggered.arguments: table, arguments passed when the interaction was registered.
Last updated