mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 22:36:03 +01:00
Fix(characterSelection/server/events): Stuck on connecting to discord.
This commit is contained in:
@@ -14,10 +14,10 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
|
|||||||
deferrals.done("Your discord isn't connected to FiveM, make sure discord is open and restart FiveM.")
|
deferrals.done("Your discord isn't connected to FiveM, make sure discord is open and restart FiveM.")
|
||||||
else
|
else
|
||||||
if config.enableDiscordWhitelist then
|
if config.enableDiscordWhitelist then
|
||||||
local discordUserId = string.gsub(discordIdentifier, "discord:", "")
|
local discordUserId = discordIdentifier:gsub("discord:", "")
|
||||||
local roles = NDCore.Functions.GetUserDiscordInfo(discordUserId).roles
|
local discordInfo = NDCore.Functions.GetUserDiscordInfo(discordUserId)
|
||||||
for _, whitelistRole in pairs(config.whitelistRoles) do
|
for _, whitelistRole in pairs(config.whitelistRoles) do
|
||||||
if roles[whitelistRole] or whitelistRole == 0 or whitelistRole == "0" then
|
if whitelistRole == 0 or whitelistRole == "0" (discordInfo and discordInfo.roles[whitelistRole]) then
|
||||||
deferrals.done()
|
deferrals.done()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -88,4 +88,4 @@ end)
|
|||||||
RegisterNetEvent("ND:updateClothes", function(clothing)
|
RegisterNetEvent("ND:updateClothes", function(clothing)
|
||||||
local player = source
|
local player = source
|
||||||
NDCore.Functions.UpdateClothes(NDCore.Players[player].id, clothing)
|
NDCore.Functions.UpdateClothes(NDCore.Players[player].id, clothing)
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user