Hey, i want to get the ESX Character Names of the nearby players instead of the steam names for esx_inventoryhud, how would i go about doing this? because in this code(client side):
` RegisterNUICallback(
“GetNearPlayers”,
function(data, cb)
local playerPed = PlayerPedId()
local players, nearbyPlayer = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
local foundPlayers = false
local elements = {}
for i = 1, #players, 1 do
if players[i] ~= PlayerId() then
foundPlayers = true
table.insert(
elements,
{
label = GetPlayerName(players[i]),
player = GetPlayerServerId(players[i]),
}
)
end
end
if not foundPlayers then
exports.pNotify:SendNotification(
{
text = _U("players_nearby"),
type = "error",
timeout = 3000,
layout = "bottomCenter",
queue = "inventoryhud"
}
)
else
SendNUIMessage(
{
action = "nearPlayers",
foundAny = foundPlayers,
players = elements,
item = data.item
}
)
end
cb("ok")
end
)`
it gets the Steam name with label = GetPlayerName(players[i])
but to get the Character Name i somehow have to pass the players to the Server, and do e.g xPlayer.getName() for each one and return them back to the client right? how does this work