Hi i recently moved to onesync and with es admin and spectate on the home screen it says there no players on server and you have to be near them to show there player id and able to spectate is there a way to make it so im able to get the player id and able to spectate regardless the distance since i know with onesync you need to be near them to be able to get there player id from home screen and able to spectate them
Use a different admin menu that’s not unmaintained?
do you know any script which can integrated with onesync or with this what part to i have to edit to make it it that everyone shows on the list who joins the server because one sync has changed the last time i used it because you have to be within a certain range for the player to show up on spectate menu or on the home screen on esx admin. is there a way to extend the range?
Did you get an answer
use
in es_admin2 replace this in client
function getPlayers()
local players = {}
local maxplayers = GetConvarInt('sv_maxclients', 128)
for i = 0, maxplayers do
if NetworkIsPlayerActive(i) then
table.insert(players, {id = GetPlayerServerId(i), name = GetPlayerName(i)})
end
end
return players
end
with this
local PlayerData = {}
RegisterNetEvent("SendPlayerData")
AddEventHandler("SendPlayerData", function(playerData, data)
PlayerData = playerData
end)
function getPlayers()
local players = {}
players = PlayerData
return players
end
and on server side place this
local function SendPlayerData()
Citizen.SetTimeout(10000, SendPlayerData)
local data = {}
for _, player in ipairs(GetPlayers()) do
table.insert(data, {id = player, name = GetPlayerName(player)})
end
TriggerLatentClientEvent("SendPlayerData", -1, #data, data)
end
SendPlayerData()