[Release] Discord Vehicle Whitelist - Vehicle Whitelist Based on Roles [2.1]

Is it finding your ID. Is the role Id set up correctly? DM me your output in server console and client.

DM Where?

Here on the forums.

Hiya Faxes,

Many thanks for another awesome release.
I’ve learnt a lot from you, just by reading the posts you’ve made and code you have done.

Thought I had better mention this one, as for the roles that are in the array.
If the found role is not at the end, it will trigger the hasPerms to still be false.

As a work around, once it finds the authorised role, I added a ‘break’ just under the first if true check, to end the for x do loop.

if exports.DiscordPermissions:IsRolePresent(src, roles[i]) then
	TriggerClientEvent("FaxDisVeh:CheckPermission:Return", src, true)
	print("Vehicle Permissions Granted.")
	break
else

Many thanks again for your efforts!
DK

Does the discord bot need to be online?

@Alex_Lukeszk,

Wrong thread bud.
But no, the bot that does the Discord ID check on your server doesn’t have to be “online”.

This is the proper thread to ask questions about that script.
Discord Role For Permission Script

It’s tested with multiple roles. Never had the issue of it only finding the last one. Are you on the updated version?

Sure am!

I found it a little odd.
As an example, I had three roles inside the array.

{
"Member",
"Admin",
"Developer",
}

Now, don’t get me wrong:
It did check for all the roles and found them, but if someone only had the Role of an Admin, for some reason it seemed to check all three roles rather than stopping on the confirmed true.

With Admin being the second, it was flicked back to a “False” boolean from the Developer check.

At least, this is all what occurred for me? :thinking:

In terms of my Discord Layout, my admins love handing out roles.
I also wanted to try and limit the amount of checks it could potentially have to do, prior to confirming.

To have it make a little more sense, I set mine up to restrict emergency services vehicles.
But I wanted to allow other members of another service to drive them if required.

However if the array had a “normal member” role as its last in the array, not the “Police” role lets say as fourth of five in total, it would still trigger the havePerms to end with a false as the “normal member” would not be allowed to drive the list of restricted vehicles. As it checked all the roles and the last was a No Soup for you.

I believe it’s just checking for every role within the array and not settling on the role within the array, so i breaked it.

Thanks again!

Going to try this on my server

1 Like

Nice. If you have issues make sure to contact me somewhere :stuck_out_tongue:

1 Like

Went over the readme and instructions for hours over and over, everything looks fine , but still cant get it to work any help?

Honestly think you should make it so it checks every 5 min or so if the user has permission and if they loose permission they will not be able to use the vehicle. instead of having it check every time the user joins, Nice release even tho!

It checks every time the user spawns. A loop would be easy to-do. However it wont be in the base script.

Alright, just thought it could be useful

1 Like

work witch add on?

could i get you to be a dev on a server?

I can’t get this to work no matter what i try.

Hey, I have DiscordWhitelist installed and I want this one. But when I’ve configured all the stuff it just saying: DiscordWhitelist: Checking Permissions

Check and make sure it’s configured correctly

discord_perms:
asd

DiscordVhicleWhitelist: