Update main.lua

This commit is contained in:
Andy
2023-12-20 13:02:13 +01:00
committed by GitHub
parent 3f0c47c2d0
commit 289d040b5c

View File

@@ -3,7 +3,6 @@ NDCore.players = {}
PlayersInfo = {} PlayersInfo = {}
local resourceName = GetCurrentResourceName() local resourceName = GetCurrentResourceName()
local tempPlayersInfo = {} local tempPlayersInfo = {}
local next = next
Config = { Config = {
serverName = GetConvar("core:serverName", "Unconfigured ND-Core Server"), serverName = GetConvar("core:serverName", "Unconfigured ND-Core Server"),
@@ -95,12 +94,12 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
local tempSrc = source local tempSrc = source
local identifiers = getIdentifierList(tempSrc) local identifiers = getIdentifierList(tempSrc)
local mainIdentifier = identifiers[Config.characterIdentifier] local mainIdentifier = identifiers[Config.characterIdentifier]
local discordInfo = {} local discordInfo = nil
deferrals.defer() deferrals.defer()
Wait(0) Wait(0)
if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and next(discordInfo) == nil then if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" then
discordInfo = checkDiscordIdentifier(identifiers) discordInfo = checkDiscordIdentifier(identifiers)
if not discordInfo then if not discordInfo then
deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite)) deferrals.done(("Your discord was not found, join our discord here: %s."):format(Config.discordInvite))