ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getAccountsByData

Function

getAccountsByData

ServerAccountsIdentical to MTA:SA

Returns the accounts whose data under a key equals the given value.

Syntax

table getAccountsByData(string dataName, mixed value)

Arguments

dataNamestring
The key.
valuemixed
The value.

Returns

A table of accounts.

Example

for _, acc in ipairs(getAccountsByData("vip", true)) do
    outputServerLog("VIP: " .. getAccountName(acc))
end