feat(es_extended): Better error messaging to ensure onesync infinity is enabled

This commit is contained in:
Mycroft
2023-03-01 10:27:52 -08:00
parent eeadbbc6d4
commit 3a77657679
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -408,7 +408,7 @@ function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked)
networked = networked or true
local player_coords = GetEntityCoords(ESX.PlayerData.ped)
local dist = #(player_coords - vector)
if dist > 424 then
if dist > 424 then -- Onesync infinity Range (https://docs.fivem.net/docs/scripting-reference/onesync/)
local executing_resource = GetInvokingResource() or "Unknown"
return print(("[^1ERROR^7] Resource ^5%s^7 Tried to spawn vehicle on the client but the position is too far away (Out of onesync range)."):format(executing_resource))
end
-1
View File
@@ -75,7 +75,6 @@ files {
dependencies {
'/server:5949',
'/onesync',
'oxmysql',
'spawnmanager',
}
+4
View File
@@ -1,6 +1,7 @@
SetMapName('San Andreas')
SetGameType('ESX Legacy')
local OnesyncState = GetConvar('onesync', 'off')
local newPlayer = 'INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `group` = ?'
local loadPlayer = 'SELECT `accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`, `meta`'
@@ -95,6 +96,9 @@ if not Config.Multichar then
local playerId = source
local identifier = ESX.GetIdentifier(playerId)
if OnesyncState == "off" or OnesyncState == "legacy" then
deferrals.done(('[ESX] ESX Requires Onesync Infinity to work. This server currently has Onesync set to: %s'):format(OnesyncState))
end
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
deferrals.done(