Documentation as well as updates to this resource have been moved to: DiscordChatRoles | Badger Docs
CURRENT VERSION: 7.0
Version 1.0
This is a very simple script that uses IllusiveTea’s discord_perms for chat roles
Picture example taken from my RP server:
You must set up IllusiveTea’s discord_perms script for this to work properly. —> Discord roles for permissions (im creative, i know)
Installation Tutorial
Example of how the chat roles are set up and what you should change:
--[[
List in order of least priority to highest with
highest priority overtaking role before it if
they have that discord role.
]]--
roleList = {
{0, "^4Civilian | "}, -- 1
{577968852852539392, "^3Trusted Civ | "}, -- 2
{577661583497363456, "^2Donator | "}, -- 3
{577631197987995678, "^1T-Mod | "}, -- 4
{506211787214159872, "^1Mod | "}, -- 5
{506212543749029900, "^1Admin | "}, -- 6
{577966729981067305, "^6Management | "}, -- 7
{506212786481922058, "^5Owner | "}, -- 8
}
-- For allowing colored chat
allowedColors = {3, 4, 5, 6, 7, 8}
allowedRed = {4, 5, 6, 7, 8}
The 1s should be replaced with IDs of the respective roles in your discord server. (0 should stay for Civilian as it is the default role for all users)
Installation
- Download DiscordChatRoles from Dropbox
- Extract the .zip and place the folder in your /resources/ of your Fivem server
- Make sure you add “start DiscordChatRoles” in your server.cfg
- Enjoy
My Other Work
Version 2.0
Chat colors can now be restricted to certain groups. The color red can also be restricted to only staff ranks!
Version 3.0
NEW FEATURE
There is now a StaffChat for your staff members to use:
Permission to use /sc and /staffchat:
StaffChat.Toggle
Version 4.0
Toggle off getting StaffChat messages (good for staff members if they are streaming their own RP)
Commands:
/sc toggle
/staffchat toggle
Version 5.0
NEW FEATURE
You can now change your chat-tags with the in-game command using /chattag and /chattag [id]
Version 6.0
NEW FEATURE
You can now change your chat-color when you talk in-game using /cc or /chatcolor
Commands:
/cc - List out the chat colors you have access to
/chatcolor - List out the chat colors you have access to
/chatcolor - Change chatcolor to the ID specified
/cc - Change chatcolor to the ID specified
How it works?
You basically set this up using a config in which the keys are the permission ACE value that gives them access to see and use those chat colors.
Config (you’ll have to find this in server.lua, in a future version I’ll move it to the top though):
local availColors =
{
['DiscordChatRoles.Access.Donator'] = {
['White'] = {'^0'},
['Green'] = {'^2'},
['Yellow'] = {'^3'},
['Blue'] = {'^4'},
['Light Blue'] = {'^5'},
['Purple'] = {'^6'},
['White'] = {'^7'},
['Pink'] = {'^9'},
['Police'] = {'^1', '^4'},
['Police2'] = {'^4', '^1'},
['Christmas'] = {'^2', '^1'},
['Christmas2'] = {'^1', '^2'},
},
['DiscordChatRoles.Access.Elite'] = {
['RainbowYGB'] = {'^3', '^2', '^4'},
['RainbowFull'] = {'^3', '^4', '^1', '^5', '^6', '^7', '^9'},
},
['DiscordChatRoles.Access.Staff'] = {
['Red'] = {'^1'},
}
}
Following the format of the config, you can add multiple different permission for chat colors and set up a vast variety of different pattern combinations!
I hope you all enjoy! Merry Christmas to all!