getAccountsByData
Client-side
Server-side
Shared
This function returns a table containing all accounts with specified dataName and value (set with setAccountData).
OOP Syntax Help! I don't understand this!
- Method:Account.getAllByData(...)
Syntax
table|false getAccountsByData ( string dataName, string value )Required arguments
- dataName: The name of the data.
- value: The value the dataName should have.
Returns
Returns table containing the accounts associated with specified value at dataName. Returns false if invalid arguments were specified.
- table|false: accounts table
Code Examples
server
This example displays in the chat how many players are working in the police in a sample RPG gamemode after typing the command policecount.
addCommandHandler('policecount', function(player, cmd) local accounts = getAccountsByData('rpg.job', 'police-officer') outputChatBox('There are '..#accounts..' police officers working in the police', player)end)See Also
Account Functions
- addAccount
- copyAccountData
- getAccount
- getAccountByID
- getAccountData
- getAccountID
- getAccountIP
- getAccountName
- getAccountPlayer
- getAccounts
- getAccountsByData
- getAccountsByIP
- getAccountsBySerial
- getAccountSerial
- getAccountTypeNew
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountName
- setAccountPassword
- setAccountSerialNew