Chat Toolbox
Easily and quickly create as many commands as you'll ever need with this modular toolbox at your disposal! Offering many commands out of the box with support for all of the major frameworks (and standalone!) out of the box.
Installation
- Download or update
ox_lib. Make sure to download the release (opens in a new tab) - Download
TAM_ChatToolBoxfrom Github (opens in a new tab) or Keymaster (opens in a new tab) - Drag and drop both
ox_libandTAM_ChatToolBoxinto your resources folder. - Add
ox_libandTAM_ChatToolBoxto your server or resources.cfg. Always be sure thatox_libis starting first
ensure ox_lib
ensure TAM_changelog- Done! You're ready to configure it.
Configuration
- Edit
config.lualocated atdata/config.luain your favorite code editor/IDE to your liking. - Edit
commands.lualocated atdata/commands.luain your favorite code editor/IDE to your liking. See here (opens in a new tab) for all the available options - Edit
server.lualocated atmodules/callbacks/modules.luain your favorite code editor/IDE to your liking. See here (opens in a new tab) for all the available options - Edit
modes.lualocated atdata/modes.luain your favorite code editor/IDE to your liking. See here (opens in a new tab) for all the available options
Command Parameters
We've setup commands to be dynamic, meaning you can register as many commands as you want.
In order to change the command name, change the string that's infront of it. Ex: commands["commandName"] = {options}
Here's the available options:
- enabled:
boolean- Enable or disable the command.
- description:
string- The description or help text to display when the command is entered.
- global?:
boolean- Enable or disabling the command being seen by everyone on the server or just locally.
- If not specified, it defaults to global.
- groups:
stringortableorboolean- Group(s) that have the permission to use the command, set to false to allow everyone.
- Specify either the name of an ace perm group or the name of a ND Core group.
- params?:
table[]- name:
string - type:
'string'or'number'or'playerId' - help:
string - optional:
parameter
- name:
- prefix?:
string- The prefix that ammended to the message
- message?:
string- Message to send back in the chat to the player when the command is ran.
Callbacks
Callbacks are functions that are ran for the specific command, for example:
callbacks["players"] = function(source, args, rawCommand, info)
local players = Bridge.getPlayerCount()
TriggerClientEvent("chat:addMessage", source, {args = {info.prefix .. ("There are currently %s players online"):format(players)}})
endwill send a chat message saying the current number of players on the server whenever someone runs the players command.
Mode Parameters
Modes are chat modes that are setup to be modular to add unlimited chat modes.
Here's the list of options:
- displayName:
string- What the display name should be for the chat mode.
- color:
string- Color of the display name on the chat box.
- groups:
stringortableorboolean- Groups that have access to see & send messages in the mode.
- Set to false to allow all players to see messages.
- prefix:
stringorboolean- Prefix to ammend to messages sent in this group.
- Set to false to disable.