juaosilv Posted May 30, 2019 Share Posted May 30, 2019 Olá, como faço pra puxar a quantidade de usuários online numa ElementDate? Preciso puxar quantos usuários online tem na element "Job" == "Policial". Link to comment
Jonas^ Posted May 30, 2019 Share Posted May 30, 2019 Use a função getPlayersByData -- function getPlayersByData (dataName) if dataName and type(dataName) == "string" then local playersTable = {} for i,v in ipairs(getElementsByType("player")) do if getElementData (v, dataName) then table.insert (playersTable, getPlayerName(v)) end end if #playersTable == 0 then return false end return playersTable end return false end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now