Set up game permissions
Give players permissions in game from their Discord roles, website roles, ranks, divisions and CAD duty. LonexOne makes the ACE groups and gives them to the right players, so you don't keep a permissions.cfg or a Discord bot token on your server.
Game Permissions is part of the Mechanics module. It does the job of DiscordAcePerms and Badger_Discord_API, from the website.
FiveM checks permissions with ACEs. A group, like group.moderator, holds permissions, like vMenu.NoClip. Players are put in groups. Other resources, like vMenu and EasyAdmin, then check whether a player has a permission.
On the website you make the groups, choose who gets each one and pick what each one can do. The LonexOne resource adds the groups to your server, puts each player in theirs when they join, and keeps it up to date while they play.
Before you start#
- Game Permissions is in beta, so it's only switched on for some communities for now. If you'd like to try it, ask us in support.
- The Mechanics module needs to be installed.
- Your game server needs the LonexOne FiveM resource, version 0.13.0 or newer. See Install the LonexOne FiveM resource.
- To use Discord roles, the LonexOne bot needs to be in your main Discord server. See Discord servers in the panel. Roles from your other linked servers, like department Discords, can be used too once the bot is in them.
- To change it, you need the Set up game permissions permission. A group can hand out console commands, so only give this to people you trust with the server.
Let LonexOne give out permissions#
FiveM only lets a resource add groups and put players in them when server.cfg allows it. Add these lines to server.cfg, then restart the server:
add_ace resource.lonexone command.add_ace allow
add_ace resource.lonexone command.remove_ace allow
add_ace resource.lonexone command.add_principal allow
add_ace resource.lonexone command.remove_principal allow
If a line is missing, the server console says which, and the Game Permissions page shows the lines at the top.
Make your first group#
- Click Game permissions under Mechanics in the sidebar.
- Click + New. Type a name, like Moderator. The name in game fills in by itself, like
group.moderator. Click Done. - On the right, click the roles, ranks or divisions that should get the group, or drag them onto it.
- Click Add permissions and tick what the group can do, or add a whole pack like vMenu: staff tools.
- Click Save.
Players who are in game get the change within a few seconds when your community uses the CAD, or within a minute when it doesn't. Players who join later get their groups as they connect.
See Use the game permissions board for everything the board does.
Moving over from DiscordAcePerms#
- Click Import config and paste your config.lua and permissions.cfg, or make the same groups on the board by hand. Keep the names in game the same, like
group.moderator, so anything that relies on them still works. See Import game permissions from a config. - Take the
add_principallines that DiscordAcePerms made out of your server, and remove theDiscordAcePermsresource fromserver.cfg. - Restart the server.
Your add_ace lines in server.cfg keep working. LonexOne never removes a permission or a group member it didn't add itself.
/refreshperms#
Changes on the website reach players on their own. If someone has just been given a Discord role, they can type /refreshperms to have their roles read again straight away. You can rename the command under Status & servers with the other commands.
/myperms#
Players can type /myperms to see their groups in chat, why they have each one, and how many locked vehicles, weapons and peds they can use. Only they see it. It needs version 0.14.0 of the resource.
More you can do#
- Lock vehicles, weapons and peds to groups, in place of DiscordVehiclesRestrict, DiscordWeaponPerms and DiscordPedPerms.
- Give a group for a set time, like a trial week for new staff.
See also
Can't find what you need?
Open a ticket in our Discord and someone from the team will help. Found a bug, or missing a feature? Tell us on the feedback board.