The missing identifier simply means that the discord identifier is missing from the user, so it will automatically return false, theres nothing i can do about this though.
I know this is a really stupid question but im just asking to know. Where does it get the roles from? Is it suppoeted on a specific base or is this a standalone script?
This is standalone you get the role ids from discord.
Whenever you connect to a FiveM server with discord open it will send your discord id to the server. With that ID and other ID’s such as a server ID you can check if someone has certain roles withing a discord server.
What bot id should i put? Or should i just leave it?
You need to make a bot on discord and add the id from your bot to the script
Im getting this error.
And i am running on server build : 1020-157b6d79e4fb74704e2125a0bc2028ee3b46b8db
You sure you didnt just use it on the client? the export is only available serverside, and its working fine on mine, are you sure discord_perms is the correct name and also running, and if you do change the resource name, make sure that you actually change the export to match it
NVM it is server side.
Yeah, the script is server side.
local hasPerms = exports.discord_perms:IsRolePresent(source, "ATC")
AddEventHandler('chatMessage', function(Source, Name, Msg)
args = stringsplit(Msg, " ")
Msg = Emojit(Msg)
CancelEvent()
if string.find(args[1], "/") then
local cmd = args[1]
table.remove(args, 1)
else
local player = GetPlayerIdentifiers(Source)[1]
if hasPerms(source, "ATC") then
TriggerEvent('chatMessage', -1, "ðATC | " .. Name, { 255, 0, 255 }, Msg)
else
TriggeEvent('chatMessage', -1, "âï¸Pilot | " .. Name, { 211, 211, 211 }, Msg)
end
end
end)
__resource.lua
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937"
server_script 'sv_chat.lua'
whats the resource name which has the discord perm system in it even?
Why do you have them outside of the event? source isnt even valid then?
Hi I’m not good at all with coding and was wondering if you could help me over discord so that I can get it working properly. My discord name is: GMBS hothead#3174
Hmmm. I’m fairly new ith .lua I can work with it to an extent, but I am nowhere near great so i was wondering if it would be possible to set up a vehicle black/whitelist using this script? If so could someone maybe help me as to how I might do it, or if someone was to make this that would be great
just made a PR to add the ability to get all roles at once in a table.
Anyone used this yet to add players to ace permission groups? If so any examples?
i do have another version which adds ace perms, its not the greatest system for it im pretty sure, but it works. Might release it sometime.
Please do.
Here you go then:
Ensure to read
else this system will not function otherwise. Check the branch out here:
I will not really support this too much as it was more of a test and seeing how well this idea worked, and never planned on releasing it.