ZH-CN/getAccount: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
m (Добавление языков) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 12: | Line 12: | ||
===选填参数=== | ===选填参数=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
*'''password:''' | *'''password:''' 帐户的密码。如果未指定此参数,则可以获取帐户的任何密码,否则密码必须与帐户的密码匹配. | ||
{{New items|3.0157|1.5.6| | {{New items|3.0157|1.5.6| | ||
* '''caseSensitive''': | * '''caseSensitive''': 指定在搜索帐户时是否忽略大小写. | ||
|16257}} | |16257}} | ||
=== | ===返回值=== | ||
Returns an [[account]] or ''false'' if an account matching the username specified (and password, if specified) could not be found. | Returns an [[account]] or ''false'' if an account matching the username specified (and password, if specified) could not be found. | ||
== | ==示例== | ||
<section name="Server example 1" class="server" show="true"> | <section name="Server example 1" class="server" show="true"> | ||
此函数检查所述帐户是否存在于internal.db数据库文件中. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("checkaccount", | addCommandHandler("checkaccount", | ||
Line 44: | Line 44: | ||
{{Account functions}} | {{Account functions}} | ||
[[en:getAccount]] | |||
[[ru:getAccount]] | |||
[[ar:getAccount]] | [[ar:getAccount]] | ||
[[es:getAccount]] | [[es:getAccount]] | ||
[[pl:GetAccount]] | [[pl:GetAccount]] | ||
[[zh-cn:getAccount]] | [[zh-cn:getAccount]] |
Latest revision as of 19:51, 11 April 2021
此函数返回特定用户的帐户account。
语法
account getAccount ( string username [, string password, bool caseSensitive = true ] )
必填参数
- username: 要检索的帐户的用户名
选填参数
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- password: 帐户的密码。如果未指定此参数,则可以获取帐户的任何密码,否则密码必须与帐户的密码匹配.
- caseSensitive: 指定在搜索帐户时是否忽略大小写.
返回值
Returns an account or false if an account matching the username specified (and password, if specified) could not be found.
示例
Click to collapse [-]
Server example 1此函数检查所述帐户是否存在于internal.db数据库文件中.
addCommandHandler("checkaccount", function(player, cmd, account) if hasObjectPermissionTo(player, "function.banPlayer" ) then -- if the player typing /checkaccount command has permission to banPlayer if account and account ~= "" then -- if the account name was mentioned if getAccount(account) then -- if the account exists outputChatBox("Account "..account.." exists in the database!", player, 0, 255, 0) else -- if the account doesn't exist outputChatBox("Account "..account.." does not exist in database", player, 0, 255, 0) end else outputChatBox("Syntax is /checkaccount [account name]", player, 255, 0, 0) end 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