I'm helping a well known server get discord whitelist, BUT IT WONT WORK SOMEONE HELP!!
FAXES Documentation > FiveM Documentation > Discord Whitelist Installation
Discord Whitelist Installation
As of version 3.0 of DiscordWhitelist it no longer uses any other script as a required dependency. It is now standalone and works by itself. Server owners/"developers" appeared to have much trouble installing the script. So now its a drag 'n drop!
Creating an Application ¶
To operate DiscordWhitelist we need to have a Discord bot application in our guild. This bot doesn't need to be online, just in the guild.
-
Create a new application from the Discord Developer Portal.
-
Click on 'Bot' on the left navigation bar and enable the bot. Then copy the Bot Token and have ready for the below.
-
Now in the 'General Information' tab copy the 'Client ID' and replace CLIENT_ID_HERE in the below template.
Now invite your bot to your guild.
Installing DiscordWhitelist ¶
Now it's time to install the script itself. First off...
-
Download and extract Discord Whitelist into your resources folder.
-
Open the server.js file in the resource and edit to include the settings you want reflected.
-
Add ensure DiscordWhitelist into your server.cfg.
Join My Discord
Was this article helpful?
105 out of 200 found this helpful
The permission system allows you to control which admins can perform which actions. For instance you can allow one admin to only view the console and kick players, but not restart the server and execute arbitrary commands. The permissions are saved in the txData/admins.json file and can be edited through the Admin Manager page by the Master admin, or users with all_permissions or manage.admins permissions.
Available Permissions
- all_permissions: Root permission that allows the user to perform any action. When set, this will remove all other permissions;
- manage.admins: Permission to create, edit and remove other admin accounts;
- settings.view: Permission to view the settings. Tokens will be redacted;
- settings.write: Permission to edit the settings;
- control.server: Permission to start/stop/restart the server;
- commands.resources: Permission to start/ensure/restart/stop resources;
- players.ban: Permission to ban/unban players;
- players.kick: Permission to kick one or all players;
- players.message: Permission to to send admin messages via DM or Broadcast command;
- players.warn: Permission to warn players;
- players.whitelist: Permission to whitelist or remove the whitelist of players;
- console.view: Permission to view the Live Console;
- console.write: Permission to execute commands in the Live Console.
- server.cfg.editor: Permission to view and edit the FXServer CFG File [eg server.cfg].
On this quick tutorial, you’ll learn to add a whitelist to any side of a useful resource, utilizing both a JSON file, or Ace Permissions. After getting applied both of those strategies, it is so simple as wrapping your code in IF statements. In your comfort, code snippets have been supplied, and a few examples given on the finish.
Stipulations:
- A fundamental understanding of LUA
- A fundamental understanding of how assets are created
- A really fundamental understanding of JSON syntax
- Sufficient to know the place commas must go as to not break your file.
So as to add a JSON whitelist to your useful resource, the very first thing you have to to do is create the whitelist file. To do that, create a brand new file inside your useful resource folder, and identify it one thing like whitelist.json. After getting accomplished this, open up the __resource.lua in your useful resource, and for those who would not have a information part, add one, like beneath:
gist.github.comAfter getting accomplished this, open your JSON file, and add the next code:
gist.github.comThis entry will act as our template, which we are going to construct upon. To get somebody’s steam hexadecimal [steamhex], go to VacBanned.com, entry the individual’s steam profile url, then copy the Steam3 ID [64bit] => [Hex], then change it’s going to the one from the template, ensuring to maintain the steam: prefix, as that is required.
The subsequent step is to create entries that we wish whitelisting for; on this tutorial, we can be whitelisting two instructions, and a shopper occasion. The way in which we are going to code the whitelist, is that any entries which might be included in somebody’s whitelist entry, can be granted [except set to false], and any entries that aren’t included, can be denied. For instance:
gist.github.comThis file has been truncated. show original
In the above example, person1 will have access to command1, command2, and event; person2 will have access to command1 and event; and person3 will only have access to event. This will make more sense later on in the tutorial.
The next step is setting up the whitelist in our client script. To start, add the following code somewhere near the top of one of your client files:
We now need to replicate what we entered in the JSON file; following the example above:
gist.github.comOnce you have entered these, ensure they are all set to false, and place the following code below the above code:
gist.github.comThis will pass our whitelist object to the server script for populating. Once you have pasted this code, open a server script of your choice, and add the following code to it:
gist.github.comThis file has been truncated. show original
[Make certain to broaden this gist]
After getting accomplished this, head again to your shopper script, and add this code:
gist.github.comWe now have all we have to add whitelist checking to our script. Beneath is an instance utilizing the instance set-up from above:
gist.github.comThis file has been truncated. show original
[Make certain to broaden this gist]
You may have added a JSON whitelist to your useful resource, effectively accomplished.
So as to add an Ace Permissions whitelist to your useful resource, the very first thing you have to to do is create the whitelist file. To do that, create a brand new file inside your useful resource folder, and identify it one thing like whitelist.cfg. After getting accomplished this, open up your server.cfg file, and add the next line above your assets:
gist.github.comAfter getting accomplished this, return to your useful resource folder, and open the whitelist.cfg file, as soon as open, paste on this code:
gist.github.comThis file has been truncated. show original
On this tutorial, we can be whitelisting two teams: person and advanced_user. person could have entry to command1, whereas advanced_user could have entry to command1, command2, and occasion. To be taught extra about how this works, see the “Additional Studying” part on the backside of this publish.
The subsequent step is establishing the whitelist in our shopper script. To start out, add the next code someplace close to the highest of one in all your shopper information:
Now, we have to replicate what we entered within the CFG file; following the instance above:
gist.github.comAfter getting entered these, guarantee they’re all set to false, and place the next code beneath the above code:
gist.github.comThis may go our whitelist object to the server script for populating. After getting pasted this code, open a server script of your alternative, and add the next code:
gist.github.comThis file has been truncated. show original
[Make certain to broaden this gist]
After getting accomplished this, head again to your shopper script, and add this code:
gist.github.comWe now have all we have to add whitelist checking to our script. Beneath is an instance utilizing the instance code above:
gist.github.comThis file has been truncated. show original
[Make certain to broaden this gist]
You may have now added an Ace Permissions Whitelist to your useful resource, congratulations.
JSON Instance
GitHubinferno-collection/Warn
A really fundamental warn command. Contribute to inferno-collection/Warn improvement by creating an account on GitHub.
Ace Instance
GitHubTomGrobbe/vMenu
vMenu is a customized server sided coach/menu, constructed utilizing a customized model of NativeUI. It has full permissions assist, so the server proprietor can resolve who’s allowed to do what. – TomGrobbe/vMenu
JSON & Ace Instance
GitHubinferno-collection/Fire-EMS-Pager
A easy useful resource that enables gamers to show their pager on, and tune it to name varieties. – inferno-collection/Hearth-EMS-Pager
Fundamentals: Aces & Principals Aces and principals are the default “permissions” system constructed into fxserver. It’s very straightforward to make use of, so long as you recognize the fundamentals and also you simply begin attempting out some stuff.
It’s additionally very straightforward to make use of this from inside assets. Simply use ExecuteCommand[] so as to add/take away aces or principals, and use IsPlayerAceAllowed[] to examine if a participant is allowed entry to an ace [both instantly or through inherited permissions].