CHAT
ES-CHAT-OS is a next-gen chat system designed for FiveM servers. Powered by modern web technologies, it introduces cutting-edge features to elevate your players' in-game communication experience.
How to Use
This is a usage example for the Lua event handler that listens to chat:addMessage
and sends formatted chat messages to the NUI frontend.
Trigger the event chat:addMessage
with the following parameters to display a chat message:
TriggerEvent('chat:addMessage', author, ctype, text, id)
-- Normal chat message from player with ID 42 TriggerEvent('chat:addMessage', "JohnDoe", "ooc", "Hello everyone!", 42)
-- OOC message from player with ID 7 TriggerEvent('chat:addMessage', "Jane", "ooc", "Is the server up?", 7)
-- System message (author can be empty string if you want) TriggerEvent('chat:addMessage', "System", "ooc", "Server will restart in 5 minutes.", 0)
📋 Command System
👤 Player Commands
/me [message] # 3D ME action (yellow)
/do [message] # 3D DO action (purple)
/ooc [message] # Out of Character chat
/ads [message] # Advertisement system
/squavk [message] # Radio message
/clear # Clear your own chat
👑 Admin Commands
/clearall # Clear the entire server chat
⚙️ Configuration
📁 shared/cfg.lua
Cfg = {
OnlyUseCommands = true, -- Use commands only
DefaultColorTheme = "#E93C53", -- Default theme color
DefaultPosition = "top-left", -- Default chat position
DefaultMeDoCommand = true, -- Enable ME/DO commands
JoinLeaveMessages = true, -- Enable join/leave notifications
SquavkCommand = true, -- Enable radio command
AdsCommand = true, -- Enable ads command
AdminClearChatCommand = true, -- Enable admin clear
}
🎨 Color Customization
CommandTypes = {
["me"] = {
name = "ME",
bgColor = "#ffe854", -- Background color
idBgColor = "#78ffe4", -- ID background color
},
}
Last updated