ZH-CN/getAccounts: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function returns a table over all the accounts that exist in the server internal.db file. (Note: accounts.xml is no longer used after ve...") |
Qwe7769611 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
此函数用于返回服务器中存在的所有帐户[[account]]的表internal.db文件.(注:accounts.xml在版本1.0.4之后不再使用) | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 06:01, 4 February 2021
此函数用于返回服务器中存在的所有帐户account的表internal.db文件.(注:accounts.xml在版本1.0.4之后不再使用)
Syntax
table getAccounts ()
OOP Syntax Help! I don't understand this!
- Note: This function is a static function underneath the Account class.
- Method: Account.getAll(...)
Returns
A table over the accounts that exist in the server internal.db file. This table might be empty.
Example
function printAmountOfAccounts ( thePlayer ) local accountTable = getAccounts () -- return the table over accounts if #accountTable == 0 then -- if the table is empty outputChatBox( "There are no accounts. :(", thePlayer ) else -- table isn't empty outputChatBox( "There are " .. #accountTable .. " accounts in this server!", thePlayer ) end end addCommandHandler( "accountcount", printAmountOfAccounts ) -- add a command handler for command 'accountcount'
See Also
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName