ZH-CN/GetAccountID: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Добавление языков) |
||
Line 27: | Line 27: | ||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:GetAccountID]] | [[en:GetAccountID]] | ||
[[ru:GetAccountID]] | |||
[[zh-cn:GetAccountID]] |
Revision as of 18:09, 11 April 2021
此函数用于获取帐户的ID,(通过账户名获取他的ID)
语法
int getAccountID ( account theAccount )
OOP 语法 什么是OOP?
- 方法: account:getID(...)
- 变量: .id
必填参数
- theAccount: 您希望获取其ID的帐户.
返回值
如果帐户不存在或传递给函数的参数无效,则返回一个包含帐户ID“false”的int
示例
当一个玩家登录到他的帐户时,这个示例在控制台中显示.
function outputOnLogin ( previous_account, current_account, auto_login ) --当玩家登录时 outputConsole("["..getAccountID(previous_account).."] "..getAccountName(previous_account).." Logged into ["..getAccountID(current_account).."]"..getAccountName(current_account)) -- 在控制台上显示 end addEventHandler("onPlayerLogin",getRootElement(),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