ZH-CN/getAccountsBySerial: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} {{New items|3.014|1.4| This function returns a table containing all accounts that were logged onto from specified serial. If the serial...") |
m (Добавление языков) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
{{Server function}} | {{Server function}} | ||
{{New items|3.014|1.4| | {{New items|3.014|1.4| | ||
此函数返回一个表[[table]],其中包含从指定的序列号[[serial]]登录的所有帐户。如果序列是空字符串,它将返回所有从未登录的帐户. | |||
}} | }} | ||
== | ==语法== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table getAccountsBySerial ( string serial ) | table getAccountsBySerial ( string serial ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{OOP_ZH-CN|This function is a static function underneath the Account class.|Account.getAllBySerial||}} | ||
=== | ===必填参数=== | ||
*'''serial:''' | *'''serial:''' 要获取帐户的序列号[[serial]] | ||
=== | ===返回值=== | ||
返回包含与指定序列号关联的帐户的“表[[table]]”。如果指定了无效参数,则返回“false”。 | |||
== | ==示例== | ||
此示例添加命令“getAccounts”,该命令输出玩家在聊天框中拥有的帐户数. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("getAccounts", | addCommandHandler("getAccounts", | ||
Line 31: | Line 31: | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:getAccountsBySerial]] | |||
[[ru:getAccountsBySerial]] | [[ru:getAccountsBySerial]] | ||
[[pl:getAccountsBySerial]] | [[pl:getAccountsBySerial]] | ||
[[zh-cn:getAccountsBySerial]] | [[zh-cn:getAccountsBySerial]] |
Latest revision as of 13:24, 12 April 2021
此函数返回一个表table,其中包含从指定的序列号serial登录的所有帐户。如果序列是空字符串,它将返回所有从未登录的帐户.
语法
table getAccountsBySerial ( string serial )
OOP 语法 什么是OOP?
- 提示: This function is a static function underneath the Account class.
- 方法: Account.getAllBySerial(...)
必填参数
- serial: 要获取帐户的序列号serial
返回值
返回包含与指定序列号关联的帐户的“表table”。如果指定了无效参数,则返回“false”。
示例
此示例添加命令“getAccounts”,该命令输出玩家在聊天框中拥有的帐户数.
addCommandHandler("getAccounts", function (player, cmd) local serial = getPlayerSerial(player) local accounts = getAccountsBySerial(serial) outputChatBox("You have " .. #accounts .. " accounts.", 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