[RELEASE] [ESX] playertables [DEV]

Player Tables


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

  • Why you must use this?

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).

  • Example
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

[DOWNLOAD]

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

15 Likes

Good job as always guille!

2 Likes

Thanks

Good work!

1 Like

Good job Guille!

1 Like

Nice Script :grinning:

1 Like

Thanks Gacha!

Nice script, but just to be clear, using ESX.GetExtendedPlayers() you can do ESX.GetExtendedPlayers(‘job’, ‘mechanic’) etc.

1 Like

Well yes, but this method is better than that.

Alright, nice =)

1 Like

Nice script

1 Like

by using this how much ms usage will be lowered ?

U are from this world? Great dude!!

1 Like

PR made to dynamically load jobs on start vs being in a config

1 Like