hi i try to add players onto my nui but its not working at all
RegisterNetEvent("PrintPlayers", function()
return updateplayers()
end)
Players = {}
function updateplayers()
for _, playerId in ipairs(GetPlayers()) do
local name = GetPlayerName(playerId)
Players[playerId] = name
end
print('Lista wszystkich graczy na serwerze')
for id, name in pairs(Players) do
print("ID: " .. id .. " | Nazwa gracza: " .. name .. "")
end
return Players
end
$("#players").click(function () {
wyswietlListeGraczy();
$.post('https://uws-ac/player');
return
})
$('#list').empty()
for(let i in event.data.players){
let player = event.data.players[i];
$('#list').append('<div class="player" id="player_' + player.id + '">' + player.name + '</div>')
}
<button id="players">Gracze</button>
<ul id="listaGraczy" style="display:none;">
are the parts of the code that should correspond to this function