Triggering this event registers several command suggestions at once, instead
of calling chat:addSuggestion once per command. This is the pattern most
resources use during onResourceStart or onClientResourceStart, where a
script registers every one of its chat commands in a single batch rather than
firing one event per command.
Event Name
chat:addSuggestionsParameters
- array suggestions: Array of suggestion objects, each shaped like
{ name, help, params }, whereparamsis an array of{ name, help }objects
Example
-- Note, each command name has to start with `/`.
TriggerEvent('chat:addSuggestions', {
{
name = '/command',
help = 'help text',
params = {
{ name = 'paramName1', help = 'param description 1' },
{ name = 'paramName2', help = 'param description 2' }
}
},
{
name = '/othercommand',
help = 'other help text',
params = {
{ name = 'otherParamName1', help = 'other param description 1' }
}
}
})