ZH-CN/GetAccountByID: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
Qwe7769611 (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
}} | }} | ||
== | ==语法== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
account getAccountByID ( int id ) | account getAccountByID ( int id ) | ||
Line 11: | Line 11: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''id:''' | *'''id:''' 要获取的账号的ID | ||
===Returns=== | ===Returns=== | ||
返回与指定ID关联的“[[账户]]”。如果指定的参数无效或没有具有此ID的帐户,则返回“false”. | |||
== | ==示例== | ||
此示例添加命令“getAccount”,该命令输出此ID代表账户的用户名. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("getAccount", | addCommandHandler("getAccount", |
Revision as of 08:34, 4 February 2021
此函数返回具有特定ID的帐户.
语法
account getAccountByID ( int id )
Required Arguments
- id: 要获取的账号的ID
Returns
返回与指定ID关联的“账户”。如果指定的参数无效或没有具有此ID的帐户,则返回“false”.
示例
此示例添加命令“getAccount”,该命令输出此ID代表账户的用户名.
addCommandHandler("getAccount", function (player, cmd, id) id = tonumber(id) local account = getAccountByID(id) if account then outputChatBox("The name of the account with that ID is: "..getAccountName(account), player) else outputChatBox("There is no account with this ID.", player) end 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