mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
feat(es_extended): Better error messaging to ensure onesync infinity is enabled
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -75,7 +75,6 @@ files {
|
||||
|
||||
dependencies {
|
||||
'/server:5949',
|
||||
'/onesync',
|
||||
'oxmysql',
|
||||
'spawnmanager',
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user