[Paid][Standalone/ESX/QBCore/NDCore] Discord role sync

DiscordRoleSync

Description :speech_balloon:

This script allows members of your Discord server to automatically receive roles depending on the access on the server.
This will be a great addition to RP servers, so that players like cops, medics, and others can automatically get roles on the server that would open access to faction channels. This is just one example where this system can be applied.


Buy: Tebex store

Check my other works
:movie_camera: Twitch Reward System
:rotating_light: Speed cameras
:moneybag: Reward Hunt System
:world_map: Map Board System


Features :spiral_notepad:

  • Standalone script
  • Support ESX, QBCore and NDCore Frameworks
  • Simple configuration
  • Framework jobid or fivem permission (IsPlayerAceAllowed) check
  • The definition takes place according to the Discord profile associated with FiveM client

Exports list :scroll:

You can use the functions of this resource in other modules through the system of exported functions

  • getPlayerDiscordRoles(source: number, cb: void): void → Get current player discord roles
  • getPlayerDiscord(source: number, cb: void): string → Get player discord
  • setDiscordToken(token: string): void → Set bot token

Example config :gear:

Config = {}

Config.Token = "" -- Bot secret token
Config.SyncIntervalMinutes = 5 -- Sync interval in minutes

Config.StorageFilename = "players" -- filename for storage data

Config.GuildID = "336710648224546816" -- Discord guild identifier (server id)
Config.Roles = {
    {
        ["role"] = "1062792257759096832", -- Discord role ID
        ["ace"] = "admin", --- Give role is Player has permission (IsPlayerAceAllowed check)
        ["job"] = "police" --- Give role is Player has job/role in framework system (Depends on current framework)
    },
}

Other data

Code accessible Config
Subscription-based No
Lines ~400
Requirements ESX, QBCore, NDCore optional
Support Yes
Future Updates Free

And what if I get removed the admin role on discord? Will it sync ingame and set me back to user?

Why pay when badger’s discord api is free? Also how does this tie into nd, esx, and qb?

I didn’t quite understand what you mean.

@marshular Of course, the API is free, but by itself it does nothing. The script works with this very API in order to manage the player’s roles in the Discord server. If you can write the code that solves this problem yourself, you don’t need to buy such a script. I never set myself the task of selling air)

The framework interaction you asked about allows the script to check the player’s work. For example, the player is a cop, and you have a cop role on Discord. Instead of giving it manually, the script will do it automatically.

@XanderWP Could you add a function to set a specific rank in a job based on a role? Like [“job_rank”] = “lspd”, 5 or something similar?

2 Likes

I see a short version of the config, but how the task is done, that the job recognizes the roles on discord?

Sorry, I’m not quite sure what you mean

Does this apply just the basic parent job “police”, “ambulance” etc? Or does it also apply roles depending on the job grade “Officer” “Sergeant” “Doctor” etc.?

1 Like