Universal Chat Command System
Are you tired of having to download old, broken and deprecated chat command resources?
Fear not, here’s a totally new universal chat command system that works standalone and with popular frameworks.
A custom system made to allow easy installation of chat command packs that allows advanced customized behavior, and allows quick and easy modification for server owners.
Features
- Framework compatiblity (vRP & ESX)
- Automatic name formatting based on server frameworks
- Easy configuration
- Simple drag-and-drop installation method
- Universal bridge between chat commands and frameworks
- Potentially powerful API, yet also simple to use.
- Auto-updater, so you can easily get the newest features!
Note
This resource in itself does not contain commands, example packs can be found at the bottom of this post.
There should be enough comments etc. to get started on creating your own commands, even if you’re not an experienced programmer.
All commands can only be ran by players, and will be blocked in the console.
Download
Warning! This resource depends on a feature only available since FXServer version 1226
!
If you are using linux!
Instructions Linux Compatibility
Seems like this method is currently not linux compatible then.
A workaround is to between the
server_script "commands/*.lua"
and the
server_script "system/sv_fxcheck_*.lua"
lines in the __resource.lua
file, you can add each command pack as a server_script
.
F.ex:
server_script "commands/*.lua"
server_script "commands/cmds_roleplay_toolkit.lua"
server_script "commands/cmds_admin.lua"
server_script "system/sv_fxcheck_*.lua"
This will still show the warning in the console, but the packs will be loaded.
Also, do note that whenever support comes around for drag-and-drop files, your files will be loaded twice and you need to remove the manual additions.
Resource Installation
- Download the repository
- Put the chat_commands folder in your resources directory
- Add
start chat_commands
to your server config - Configure
settings.lua
to your liking- If you are using ESX or vRP, set the
use_esx
oruse_vrp
field to true!
- If you are using ESX or vRP, set the
Command Pack Installation
- Download the command pack, they usually come as
.lua
files - Drag and drop the pack file into the
chat_commands/commands
folder - You should now see that the pack is loaded when the server is started
Example packs can be found at the bottom of this post.
Settings
There are a couple settings you can configure for your server.
These can be found in the settings.lua
file.
Setting | Required | Type | Description |
---|---|---|---|
show_id | No | boolean | makes the players name also include the players ID |
logging | No | boolean | enables print output to the console (and chat during commands) |
use_esx | No | boolean | compatibility with ESX |
use_vrp | No | boolean | compatibility with vRP (f.ex Dunko’s vRP) (does not support vRP 2!) |
cb | No | function | Global callback function, can be used to log every command, or do other fancy stuff |
use_framework_name | No | boolean | automatically format names using framework systems, such as character identity |
check_updates | No | boolean | check for updates on startup (recommended) |
Credits
Version check system by @blumlaut
Example Packs
These are complete packs that serve one purpose or another. Some may require configuration.
Roleplay Toolkit
An essential roleplay command kit. No configuration required.
Expand
Commands:
Command | Description | Aliases |
---|---|---|
/me [action] |
A typical /me [action] command, has an event in place to support floating text (not implemented here) |
/do |
/ooc [message] |
Global out of character chat | |
/looc [message] |
Local out of character chat | /b |
/twitter [message] |
Global in-character tweet, showing character name plus username as handle | /twt |
Previews:
Download:
cmds_roleplay_toolkit.lua (1.6 KB)
Information Commands
Commands that give the player some information, such as Discord invites etc. (must be configured)
Expand
Commands:
Command | Description | Aliases |
---|---|---|
/discord |
Shows a discord invite link in the players chat | |
/teamspeak |
Shows a teamspeak ip in the players chat | |
/forum |
Shows a forum link in the players chat |
Preview:
Download:
cmds_info.lua (898 Bytes)
Report Command
A command that sends a report to your Discord using @flatracer’s FiveM to Discord resource:
Expand
Commands:
Command | Description | Aliases |
---|---|---|
/report [message] |
Sends a message to your Discord |
Download:
cmds_report.lua (864 Bytes)
Direct Messages / SMS
A simple DM / SMS system with a reply feature.
Expand
Commands:
Command | Description | Aliases |
---|---|---|
/sms [player] [message] |
Sends a message to the specified player | /m |
/reply [message] |
Replies to the last player you received a message from | /r |
Preview:
Download:
cmds_direct_message.lua (2.5 KB)
Administrator Announcement
A simple announcement command locked behind administrator access.
Expand
Commands:
Command | Description | Admin Only |
---|---|---|
/announce [message] |
Makes an announcement in chat | Yes |
Preview:
Download:
cmds_admin.lua (608 Bytes)
Other command packs
You are encouraged to create and release command packs. This system is made to be expanded upon by the community.
Disclaimer
Please refrain from remixing this resource.
It is intended to be a universal solution, if there are missing features, please submit a PR on GitHub with improvements.
You may include this as part of pack downloads, as long as it is not modified.
License
Attribution-NoDerivs 3.0 Unported (CC BY-ND 3.0)