ZH-CN/GetAccountID: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
m (Добавление языков)  | 
				m (Обновление информации)  | 
				||
| Line 1: | Line 1: | ||
{{Server function}}  | {{Server function}}  | ||
__NOTOC__  | __NOTOC__  | ||
{{New feature/item|3.  | {{New feature/item|3.156|1.5.5|12217|  | ||
此函数用于获取[[帐户]]的ID,(通过账户名获取他的ID)  | 此函数用于获取[[帐户]]的ID,(通过账户名获取他的ID)  | ||
}}  | }}  | ||
Latest revision as of 17:14, 12 April 2021
语法
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