[Release] DiscordPedPerms

Version 1.0
Another discord script, yes, you’re all welcome!

This one restricts peds to certain discord groups much like my other scripts!


Forgive my typing mistakes in the gif please… Thanks

You must set up IllusiveTea’s discord_perms script for this to work properly. → Discord roles for permissions (im creative, i know)

How it works

roleList = {
1, -- Trusted Civ (1)
1, -- Donator (2)
1, -- Personal (3)
}

responds to it’s respective number within the other list:

restrictedPeds = {
{}, -- Trusted Civ (1)
{}, -- Donator (2)
{
"mickeymouse",
"deadpool",
"kermit",
"blackpanther",
}, -- Personal (3)
}

Therefore blackpanther, deadpool, and kermit would be restricted to be used by the roleList group ‘Personal’

It’s quite simple :slight_smile:

Installation
  1. Download DiscordPedPerms
  2. Extract the .zip and place the folder in your /resources/ of your Fivem server
  3. Make sure you add “start DiscordPedPerms” in your server.cfg
  4. Enjoy :slight_smile:
Download

DiscordPedPerms

My Other Work

DiscordChatRoles

DiscordAcePerms

SandyVehiclesRestrict

DiscordTagIDs

DiscordVehiclesRestrict

DiscordPedPerms

BadgerAnims

DiscordWeaponPerms

BadgerTools

BadgerBankRobbery

VehicleTrustSystem

17 Likes

Love all of ur discord scripts :joy:
keep up the amazing work

2 Likes

im pretty sure you can’t have your discord link in your Topic, but i’m not a moderator so yeah.

Removed discord link as that’s not allowed in a release, see Releases Rules and F.A.Q

My bad, wasn’t aware of that

1 Like

This doesnt seem to be working for me. All your other Discord related addons i use work fine, including chat roles and ace perms, but this one, just dont work

Works fine on my own server, most likely a problem with configuration. What seems to not be working?

Well i have whitelisted staff peds to some staff roles, for example the ‘management team’ ped i have restricted to the ‘@Management Team’ role however everyone can still use it

What is your RoleList looking like?

Would you be able to help me set this up? I keep having issues, Im trying to use your discord scripts (Nearly all of them) And i can´t seem to get any of them working, Can i contact you privately so i dont have to post on 4 of your addons :s?

I’d rather you post on the threads, so then others can learn from your mistakes. Thanks.

@OfficialBadger I also cannot get the script to work after multiple attempts. I also use your DiscordVehicleRestrict with no problem but this script isn’t work at all.

The only output I’m getting on the console from this script is the following:

roles[i] 544366177036533790 equal to roleList[j] 600764201287417971 ?
roles[i] 544366177036533790 equal to roleList[j] 600764204127092746 ?
roles[i] 544366177036533790 equal to roleList[j] 600764084291371041 ?
roles[i] 544366177036533790 equal to roleList[j] 600764197244239892 ?

The 544366177036533790 is a role that’s not even part of the roleList nor part of the Discord Perms.

Here’s what I have for the roleList:

roleList = {
600764201287417971, – Fivem Director Access
600764204127092746, – Fivem Admin Access
600764084291371041, – Fivem Police Access
600764197244239892, – Fivem Fire/EMS Access
}

Here’s my restrict ped list:

restrictedPeds = {
{}, – Director (1)
{}, – Admin (2)

{
“s_f_y_cop_01”,
“s_m_y_cop_01”,
“s_f_y_sheriff_01”,
“s_m_y_sheriff_01”,
}, – Police (3)

{
“s_m_m_fireman_02”,
“s_m_y_fireman_01”,
“s_m_m_paramedic_01”,
}, – Fire/EMS (4)

}

What’s not working about it? Works fine on my test server. Make sure you got the role IDs correctly. A lot of times people mess these up with message IDs rather than role IDs. Also, that output was a debug message I forgot to get rid of. It prints out a role not even in roleList because it is comparing every role a user has to every element in the roleList.

I’ve double checked everything and it’s not restricting the peds when spawned via vMenu. I’ve only added the peds and roles to the resource as listed above. I have several discord plugins on my server and this is the only one that doesn’t work.

What is your roleList looking like? Also, I’d make sure you aren’t missing parenthesis anywhere since you could have a lua parsing error if you miss a comma or quotation mark

@OfficialBadger

I’m not getting any Lua errors. I’ve tried using the role names, the role ID’s and nothing works. I’ve tried multiple combinations including clearing cache, rebooting the server, respawning, reconnecting etc. Nothing works. My discord_perms works correctly with the DiscordVehicleRestrict and other discord resources.

Here’s my roleList:

roleList = {
600764201287417971, – Fivem Director Access
600764204127092746, – Fivem Admin Access
600764084291371041, – Fivem Police Access
600764197244239892, – Fivem Fire/EMS Access
}

Here’s my ped list for reference:


— DiscordPedPerms —

restrictedPeds = {
{}, – Director (1)

{}, – Admin (2)

{“s_f_y_cop_01”, “s_m_y_cop_01”, “s_f_y_sheriff_01”, “s_m_y_sheriff_01”,}, – Police (3)

{“s_m_m_fireman_02”, “s_m_y_fireman_01”, “s_m_m_paramedic_01”,}, – Fire/EMS (4)

}

What is your list looking like in the other file as well?

@OfficialBadger

I have edited the post above with the listed peds I’m trying to restrict.

What do you have allowedPed set to?

@OfficialBadger what ever the default is set to. Nothing was mentioned about that.

It’s set to this:

allowedPed = “xxxtentacion”