Discord roles for permissions (im creative, i know)

Your instruction are not very clear. I have tried modifying a simple vehicle blacklist script to use these perms but i get an IsPlayerAceAllowed error in the server console.

Here is the script.

if (IsDuplicityVersion()) then
    RegisterServerEvent("blacklist.checkForAdminPermissions")
    AddEventHandler('blacklist.checkForAdminPermissions', function()
        if IsPlayerAceAllowed(player, "administrator") then
            TriggerClientEvent("blacklist.setAdminPermissions", source, true)
        end
    end
end)

here is the perms.cfg

add_ace resource.discord_perms command.add_principal allow
add_ace resource.discord_perms command.remove_principal allow

add_ace group.Admin administrator allow

Whats your config like? An actual error would be nice too

1 Like

I already gave you my config.

Here is the error

cfx> InvokeNative: execution failed: Argument at index 0 was null.
Error running system event handling function for resource blacklist: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: Execution of native 00000000dedae23d in script host failed.
stack traceback:
        [C]: in upvalue '_in'
        citizen:/scripting/lua/natives_server.lua:264: in function 'IsPlayerAceAllowed'
        script.lua:4: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>

no, i mean the config.lua file.

1 Like

theres your issue though. Player is null

So would i put

AddEventHandler('blacklist.checkForAdminPermissions', function(player)

what, no? If you want to use this resource, at least know what youre doing, im not going to assist in simple coding things like this, you should research this type of thing yourself.

Thanks for the (no) help!

Im not going to teach you how to write code in fivem, you should already know this if you want to use the resource.

1 Like

I aslo get trhis error

Access denied for command add_principal.

then you probably arent executing the cfg, or you have changed the resource name.

How do i add more than one role. Cause right now i can only use members and when i try adding another one it wont work. Can someone please send me a screen shot or something!

Hey, r u able to help me with this?
Give me a call through discord.

Discord: 7zR_Ghost#4238

Im getting this in my console: An error occured, please check your config and ensure everything is correct. Error: <ā€œcodeā€: 50001, ā€œmessageā€: ā€œMissing Accessā€>. Any Ideas?

1 Like

Use a bot account with permissions?

bot account?

Yes? It requires a bot in the guild to function, hence why theres a section for BotToken. I canā€™t just wizard up your roles from thin air.

So i have to invite the bot to my discord server and give it permission?

Okayā€¦So i managed to fix that. Now i get this: ā€œNot found!ā€ canā€™t find the role?

1 Like

How do i make the bot online, bc it is always offline

Add me on discord: Ghost#3120