Server Events
Server Events
Section titled “Server Events”Compatibility Events
Section titled “Compatibility Events”These events are provided for compatibility with other chat systems and can be triggered by other resources.
chat:addMessage
Section titled “chat:addMessage”Legacy event for adding messages (compatibility mode).
TriggerServerEvent('chat:addMessage', msg)Event Parameters:
msg(table) - Message data table
Message Data Structure:
{ args = table, -- Array of message parts color = table -- RGB color array { r, g, b }}Example:
TriggerServerEvent('chat:addMessage', { args = { "Hello", "world" }, color = { 255, 255, 255 }})chat:addSuggestion
Section titled “chat:addSuggestion”Legacy event for adding command suggestions.
TriggerClientEvent('chat:addSuggestion', playerId, { name = string, help = string, params = table})Event Parameters:
playerId(number) - Target player IDdata(table) - Suggestion data table
Suggestion Data Structure:
{ name = string, -- Command name (with or without '/') help = string, -- Help text params = table -- Array of parameter objects}Parameter Structure:
{ name = string, -- Parameter name help = string -- Parameter help text}Example:
TriggerClientEvent('chat:addSuggestion', source, { name = "/test", help = "Test command", params = { { name = "param1", help = "First parameter" } }})chat:addSuggestions
Section titled “chat:addSuggestions”Legacy event for adding multiple command suggestions.
TriggerClientEvent('chat:addSuggestions', playerId, suggestions)Event Parameters:
playerId(number) - Target player IDsuggestions(table) - Array of suggestion objects
Example:
local suggestions = { { name = "/test1", help = "Test command 1" }, { name = "/test2", help = "Test command 2" }}TriggerClientEvent('chat:addSuggestions', source, suggestions)Internal Events
Section titled “Internal Events”These events are used internally by the script and should not be triggered manually. They can be listened to for integration purposes.
Message Events
Section titled “Message Events”The script handles various message-related events internally. These events are primarily for the script’s own use, but you can listen to them if needed for advanced integrations.
Channel Events
Section titled “Channel Events”Channel-related events are managed internally and should not be triggered externally.