mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 13:56:02 +01:00
fix(ND_Core) fixed departments not showing for players in discord
ykyk
This commit is contained in:
@@ -50,14 +50,16 @@ end)
|
||||
RegisterNetEvent("ND_CharacterSelection:checkPerms")
|
||||
AddEventHandler("ND_CharacterSelection:checkPerms", function()
|
||||
local player = source
|
||||
local discordUserId = string.gsub(NDCore.Functions.GetPlayerIdentifierFromType("discord", player), "discord:", "")
|
||||
local discordUserId = NDCore.Functions.GetPlayerIdentifierFromType("discord", player):gsub("discord:", "")
|
||||
local allowedRoles = {}
|
||||
local roles = NDCore.Functions.GetUserDiscordInfo(discordUserId).roles
|
||||
|
||||
print("test")
|
||||
local discordInfo = NDCore.Functions.GetUserDiscordInfo(discordUserId)
|
||||
print(discordInfo)
|
||||
-- Check if the players discord roles will grant them permission to the department.
|
||||
for dept, roleTable in pairs(config.departments) do
|
||||
for _, roleId in pairs(roleTable) do
|
||||
if roles[roleId] or roleId == 0 or roleId == "0" then
|
||||
print(roleId)
|
||||
if roleId == 0 or roleId == "0" or (discordInfo and discordInfo.roles[roleId]) then
|
||||
table.insert(allowedRoles, dept)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user