mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
fixed errors, sorry im tired
This commit is contained in:
@@ -15,8 +15,8 @@ Config = {
|
|||||||
discordActionText2 = GetConvar("core:discordActionText2", "STORE"),
|
discordActionText2 = GetConvar("core:discordActionText2", "STORE"),
|
||||||
discordActionLink2 = GetConvar("core:discordActionLink2", "https://andyyy.tebex.io/category/fivem-scripts"),
|
discordActionLink2 = GetConvar("core:discordActionLink2", "https://andyyy.tebex.io/category/fivem-scripts"),
|
||||||
characterIdentifier = GetConvar("core:characterIdentifier", "license"),
|
characterIdentifier = GetConvar("core:characterIdentifier", "license"),
|
||||||
discordGuildId = GetConvar("core:discordGuildId", 'false'),
|
discordGuildId = GetConvar("core:discordGuildId", "false"),
|
||||||
discordBotToken = GetConvar("core:discordBotToken", 'false'),
|
discordBotToken = GetConvar("core:discordBotToken", "false"),
|
||||||
randomUnlockedVehicleChance = GetConvarInt("core:randomUnlockedVehicleChance", 30),
|
randomUnlockedVehicleChance = GetConvarInt("core:randomUnlockedVehicleChance", 30),
|
||||||
disableVehicleAirControl = GetConvarInt("core:disableVehicleAirControl", 1) == 1,
|
disableVehicleAirControl = GetConvarInt("core:disableVehicleAirControl", 1) == 1,
|
||||||
useInventoryForKeys = GetConvarInt("core:useInventoryForKeys", 1) == 1,
|
useInventoryForKeys = GetConvarInt("core:useInventoryForKeys", 1) == 1,
|
||||||
@@ -68,7 +68,7 @@ AddEventHandler("playerJoining", function(oldId)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local function checkDiscordIdentifier(identifiers)
|
local function checkDiscordIdentifier(identifiers)
|
||||||
if Config.discordBotToken == 'false'or Config.discordGuildId == 'false' then return end
|
if Config.discordBotToken == "false"or Config.discordGuildId == "false" then return end
|
||||||
|
|
||||||
local discordIdentifier = identifiers["discord"]
|
local discordIdentifier = identifiers["discord"]
|
||||||
if not discordIdentifier then return end
|
if not discordIdentifier then return end
|
||||||
@@ -77,7 +77,7 @@ local function checkDiscordIdentifier(identifiers)
|
|||||||
end
|
end
|
||||||
|
|
||||||
AddEventHandler("onResourceStart", function(name)
|
AddEventHandler("onResourceStart", function(name)
|
||||||
if name ~= resourceName or Config.discordBotToken == 'false' or Config.discordGuildId == 'false' then return end
|
if name ~= resourceName or Config.discordBotToken == "false" or Config.discordGuildId == "false" then return end
|
||||||
for _, playerId in ipairs(GetPlayers()) do
|
for _, playerId in ipairs(GetPlayers()) do
|
||||||
local src = tonumber(playerId)
|
local src = tonumber(playerId)
|
||||||
local identifiers = getIdentifierList(src)
|
local identifiers = getIdentifierList(src)
|
||||||
@@ -98,7 +98,7 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
|
|||||||
deferrals.defer()
|
deferrals.defer()
|
||||||
Wait(0)
|
Wait(0)
|
||||||
|
|
||||||
if mainIdentifier and Config.discordBotToken == 'false' and Config.discordGuildId == 'false' and not discordInfo then
|
if mainIdentifier and Config.discordBotToken ~= "false" and Config.discordGuildId ~= "false" and not discordInfo 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))
|
||||||
|
|||||||
Reference in New Issue
Block a user