GetAccountsByData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server function}} This function returns a table containing all accounts that were logged onto from specified IP-address. ==Syntax== <syntaxhighlight lang="l...")
(No difference)

Revision as of 22:16, 1 July 2018

This function returns a table containing all accounts that were logged onto from specified IP-address.

Syntax

table getAccountsByData ( string dataName, string value )

OOP Syntax Help! I don't understand this!

Note: This function is a static function underneath the Account class.
Method: Account.getAllByData(...)


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.

Example

Useless example to show how it works.
addCommandHandler("accountsbydata", function (player)
   local account = getPlayerAccount(player)
   setAccountData(account, "test", "hello")
   local accounts = getAccountsByData("test", "hello")
   outputChatBox(getAccountName(accounts[1]), player)                
end)

See Also