[Free] FivemDiscordPermissions

FivemDiscordPermissions

This resource is a better alternative to other discord ace permission scripts like the popular DiscordAcePerms. Unlike other discord ace permission scripts, this allows you to use multiple discords to give ace permissions and does not have any other dependencies.

An example use case for this would be if your server uses different discords for different departments and you want to give people in-game permissions based off of roles in the department discords. Currently, you would solve this by cluttering your main discord with random roles, but with this resource, you can just you the roles already made in the department discord.

Features

  • Give ace permissions based on discord roles
  • Able to use multiple discords to give ace permissions
  • No dependencies
  • updateperms command that updates an in game users permissions. Useful if a user received a new role while in game and doesn’t want to relog.

Download

Install Guide
  • make sure you have “developer mode” enabled on your discord account
  • dowload this repository
  • have a discord bot created
  • make sure that discord bot is in every discord that you want to have permissions for
  • drag the FivemDiscordPermissions-main into the resources folder or a subfolder of the resource folder
  • change the file name to FivemDiscordPermissions
  • add the following to your server.cfg
start FivemDiscordPermissions
add_ace resource.FivemDiscordPermissions command.add_principal allow
add_ace resource.FivemDiscordPermissions command.remove_principal allow
  • open the config.json and add your discord bots bot token
"BOT_TOKEN": "Your token goes here"
  • open the permissions.js file
  • in the file you will see the format to use but I will restate it here
["GUILD_ID_HERE"]: {
    "ROLE_ID_HERE": "PERMISSION GROUP",
},
  • all you need to do is copy and paste the format for as many discords as you have and remove the // in front of each line
  • now just fill in the blanks
  • to get the guild ID of a discord server right click on the server icon and click copy ID at the bottom
  • to get the role ID of a discord role open the server setting → click on roles → right click on the role → click copy ID
  • an example of a completed permission.js file should look something like this
const permissions = {
    // ["GUILD_ONE_ID_HERE"]: {
    //     "ROLE_ID_HERE": "PERMISSION GROUP",
    //     "ROLE_ID_HERE": "PERMISSION GROUP",
    // },
    ["723210193214767121"]: {
        "714607086562181280": "group.staff",
        "718723931682373663": "group.donator",
    },
    ["714606988675252241"]: {
        "748236405389394030": "group.lspd",
        "735948035187802192": "group.supervisor",
        "714607075027714049": "group.subdivisionname",
    },
    ["714940271074213891"]: {
        "714607084485738507": "group.bcso",
    },
}
4 Likes

Do i receive correct? When you give the job in-game, their receive the role in discord automatic?

It’s a standalone script so it doesn’t use frameworks like esx to give jobs. It only gives ace permissions based on what discord roles a player has. It’s similar to DiscordAcePerms but can use multiple guilds.

1 Like

REALLY nice script

cAn you do with a job also standalone? or maybe qb and esx?

you would need to make another script to handle giving the job. But in that script, you would need to check the player’s ace permissions to see if they can get that job. That is where this script comes in; you would use this resource to give the player an ace group if they had a certain role, then you would give that ace group a certain permission. Then in the script that gives the job, you would just check to see if they have that ace permission. Does that make sense?

1 Like

how can I integrate this into a Vehicle Whitelist script?

So lets say you have people in your discord server with a role that should give them permission to use some cars in game. Lets call this role premium and lets say the the role id is 123456789. I am assuming that you have already set up the bot and the script is in a working condition. You’d first want to get the guild of the server and put that in the permissions.js file with the given format. Then you would put the role id in the permissions.js file with a ace permission like so

const permissions = {
     ["GUILD_ID_HERE"]: {
         "123456789": "group.premium",
    },
}

in this case people with the premium role would be given the group.premium ace permission.
Then in your vehicle whitelist script all you would need to do is run a permissions check on the server to see if they have that ace permission and if they do give them the corresponding vehicles. There is plenty of tutorials on how to use ace permissions so if you need one just go look one up.