- Documentation
- Server functions
- getPlayersByData
Function
getPlayersByData
Returns the players whose data value under a key equals the given one.
Syntax
table getPlayersByData(string key, mixed value)Arguments
keystring- The data key.
valuemixed- The value to match.
Returns
A table of players.
Example
for _, cop in ipairs(getPlayersByData("job", "police")) do
outputChatBox("Napad na bank!", cop, 255, 0, 0)
end