ESX.GetPlayers

1
ESX.GetPlayers()

This function returns an array of all online players ID's.

You can use this to access each players data.

ESX.GetPlayers Exemplo

1
2
3
4
5
6
7
8
local xPlayers = ESX.GetPlayers()

for i=1, #xPlayers, 1 do
    local xPlayer = ESX.GetPlayerFromId(xPlayers[i])

    xPlayer.addMoney(100)
    xPlayer.showNotification('Here, take ~g~$100~s~ for free!')
end