Player Tables


A resource to save players in tables depending on ESX jobs.

Instead of getting all the players with ESX.GetPlayers() or ESX.GetExtendedPlayers(), ESX.GetExtendedPlayers(‘job’, ‘mechanic’) and loop getting the player job, just get all the players with an specified job reducing server side ms. (Robs or other that require get all players with an specified job).

local _police = exports['playertables']:getPlayers("police") -- Get the players that have the specified job
for k, v in pairs(_police) do -- Iterate table of players with job
    print(v) -- Print the source
    TriggerClientEvent("police:doSomething", v) -- Trigger a client event to each police in the server
end

License
This project does not contain a license, therefore you are not allowed to add one and claim it as yours. You are not allowed to sell this nor re-distribute it. You are not allowed to change/add a license. If you want to modify or make an agreement, you can contact me. Pull requests are accepted as long as they do not contain breaking changes. You can read more
HERE



Looking for paid scripts? Click here