feat: convar for compatibility

This commit is contained in:
Andyyy7666
2023-11-11 03:02:08 +01:00
parent b319d4a90a
commit c50003cfd8
6 changed files with 12 additions and 2 deletions

View File

@@ -13,7 +13,8 @@ Config = {
randomUnlockedVehicleChance = GetConvarInt("core:randomUnlockedVehicleChance", 30),
disableVehicleAirControl = GetConvarInt("core:disableVehicleAirControl", 1) == 1,
useInventoryForKeys = GetConvarInt("core:useInventoryForKeys", 1) == 1,
groups = json.decode(GetConvar("core:groups", "[]"))
groups = json.decode(GetConvar("core:groups", "[]")),
compatibility = json.decode(GetConvar("core:compatibility", "[]"))
}
-- Discord rich presence.

View File

@@ -1,3 +1,5 @@
if not lib.table.contains(Config.compatibility, "backwards") then return end
NDCore.Functions = {}
NDCore.Functions.GetSelectedCharacter = NDCore.getPlayer
NDCore.Functions.GetCharacters = NDCore.getCharacters

View File

@@ -1,3 +1,5 @@
if not lib.table.contains(Config.compatibility, "backwards") then return end
exports("GetCoreObject", function()
return NDCore
end)

View File

@@ -0,0 +1,2 @@
if not lib.table.contains(Config.compatibility, "esx") then return end

View File

@@ -1,3 +1,5 @@
if not lib.table.contains(Config.compatibility, "esx") then return end
local itemNames
local registeredItems = {}

View File

@@ -23,7 +23,8 @@ Config = {
groups = json.decode(GetConvar("core:groups", "[]")),
admins = json.decode(GetConvar("core:admins", "[]")),
adminDiscordRoles = json.decode(GetConvar("core:adminDiscordRoles", "[]")),
multiCharacter = false
multiCharacter = false,
compatibility = json.decode(GetConvar("core:compatibility", "[]"))
}
SetConvarServerInfo("Discord", Config.discordInvite)