feat(esx_lib): add isEnhanced game edition detection

xLib.isEnhanced() returns whether the game runs GTA V Enhanced (server: gamename convar, client: IsGameEnhancedVersion native). es_extended reads it once and requires OneSync Infinity on Legacy only, since Enhanced runs OneSync natively.
This commit is contained in:
ASTROWwwW
2026-07-23 20:51:21 +02:00
parent ca597cf6f4
commit 94002da05b
2 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ SetMapName("San Andreas")
SetGameType("ESX Legacy")
local oneSyncState = GetConvar("onesync", "off")
local isEnhanced = xLib.isEnhanced()
local newPlayer = "INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `ssn` = ?, `group` = ?"
local loadPlayer = "SELECT `accounts`, `ssn`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`, `metadata`"
@@ -151,7 +152,7 @@ if not Config.Multichar then
return deferrals.done(("[ESX] ESX Requires a minimum Artifact version of 10188, Please update your server."))
end
if oneSyncState == "off" or oneSyncState == "legacy" then
if not isEnhanced and (oneSyncState == "off" or oneSyncState == "legacy") then
return deferrals.done(("[ESX] ESX Requires Onesync Infinity to work. This server currently has Onesync set to: %s"):format(oneSyncState))
end
@@ -0,0 +1,17 @@
local ENHANCED_GAME_NAMES <const> = {
["gta5enhanced"] = true,
["gta5_enhanced"] = true
}
local isEnhanced
if IsDuplicityVersion() then
isEnhanced = ENHANCED_GAME_NAMES[GetConvar("gamename", "gta5")] == true
else
isEnhanced = type(IsGameEnhancedVersion) == "function" and IsGameEnhancedVersion() == true
end
---@return boolean
return function()
return isEnhanced
end