ZH-CN/GetAccountsByData: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} {{New feature/item|3.0160|1.5.5|11747| This function returns a table containing all accounts with specified dataName and value (set with set...") |
m (Обновление информации) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
{{New feature/item|3. | {{New feature/item|3.156|1.5.5|11747| | ||
此函数返回一个[[表]],其中包含具有指定dataName和value的所有帐户(使用setAccountData设置). | |||
}} | }} | ||
== | ==语法== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table getAccountsByData ( string dataName, string value ) | table getAccountsByData ( string dataName, string value ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{OOP_ZH-CN|This function is a static function underneath the Account class.|Account.getAllByData||}} | ||
=== | ===必填参数=== | ||
*'''dataName:''' | *'''dataName:''' 数据的名称 | ||
*'''value:''' | *'''value:''' 数据名称所对应的值 | ||
=== | ===返回值=== | ||
返回一个 ''[[table]]'' ,其中包括了账号在 dataName 所关联的值。返回 ''false'' 如果参数有误。 | |||
== | ==示例== | ||
用一个无用的例子来说明它是如何工作的. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("accountsbydata", function (player) | addCommandHandler("accountsbydata", function (player) | ||
Line 30: | Line 30: | ||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:GetAccountsByData]] | |||
[[ru:getAccountsByData]] | |||
[[zh-cn:GetAccountsByData]] | [[zh-cn:GetAccountsByData]] |
Latest revision as of 17:10, 12 April 2021
语法
table getAccountsByData ( string dataName, string value )
OOP 语法 什么是OOP?
- 提示: This function is a static function underneath the Account class.
- 方法: Account.getAllByData(...)
必填参数
- dataName: 数据的名称
- value: 数据名称所对应的值
返回值
返回一个 table ,其中包括了账号在 dataName 所关联的值。返回 false 如果参数有误。
示例
用一个无用的例子来说明它是如何工作的.
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
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName