ZH-CN/SetAccountName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Обновление информации) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Server function}} | {{Server function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New feature/item|3. | {{New feature/item|3.155|1.5.5|11747| | ||
此函数用于设置[[帐户]]的名称. | 此函数用于设置[[帐户]]的名称. | ||
}} | }} | ||
Line 14: | Line 14: | ||
*'''name:''' 新的账户名. | *'''name:''' 新的账户名. | ||
=== | ===可选参数=== | ||
*'''allowCaseVariations:''' 用户名是否区分大小写(如果设置为true,则用户名“Bob”和“bob”将引用不同的帐户) | *'''allowCaseVariations:''' 用户名是否区分大小写(如果设置为true,则用户名“Bob”和“bob”将引用不同的帐户) | ||
Line 37: | Line 37: | ||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:SetAccountName]] | |||
[[ru:setAccountName]] | |||
[[zh-cn:SetAccountName]] | [[zh-cn:SetAccountName]] |
Latest revision as of 17:12, 12 April 2021
语法
bool setAccountName ( account theAccount, string name [, bool allowCaseVariations = false] )
OOP 语法 什么是OOP?
- 方法: account:setName(...)
- 变量: .name
- 对称函数: getAccountName
必填参数
- theAccount: 您要更改名称的帐户.
- name: 新的账户名.
可选参数
- allowCaseVariations: 用户名是否区分大小写(如果设置为true,则用户名“Bob”和“bob”将引用不同的帐户)
返回值
如果设置了帐户名,则返回“true”;如果指定了无效参数,则返回“false”.
示例
更改帐户名称.
addCommandHandler("changeaccountname", function(player, _, oldname, newname) if not oldname or not newname then return end local account = getAccount(oldname) if not account then return end setAccountName(account, newname) 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