ZH-CN/GetAccountName: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
m (Добавление языков) |
||
(One intermediate revision by one other user not shown) | |||
Line 11: | Line 11: | ||
*'''theAccount:''' 你希望获得的帐户名称. | *'''theAccount:''' 你希望获得的帐户名称. | ||
=== | ===返回值=== | ||
如果帐户不存在或传递给函数的参数无效,则返回包含帐户名“false”的字符串. | 如果帐户不存在或传递给函数的参数无效,则返回包含帐户名“false”的字符串. | ||
Line 26: | Line 26: | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:getAccountName]] | |||
[[ru:getAccountName]] | [[ru:getAccountName]] | ||
[[es:getAccountName]] | [[es:getAccountName]] |
Latest revision as of 20:09, 11 April 2021
此函数用于获取帐户account的名称.
语法
string getAccountName ( account theAccount )
OOP 语法 什么是OOP?
- 方法: account:getName(...)
- 变量: .name
必填函数
- theAccount: 你希望获得的帐户名称.
返回值
如果帐户不存在或传递给函数的参数无效,则返回包含帐户名“false”的字符串.
示例
当一个玩家登录到他的帐户时,这个例子在控制台中显示.
function outputOnLogin ( previous_account, current_account, auto_login ) --当玩家登陆时 outputConsole(getAccountName(previous_account).." Logged into "..getAccountName(current_account)) -- 在控制台上显示 end addEventHandler("onPlayerLogin",root,outputOnLogin ) --添加事件处理程序
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