ZH-CN/GetAccountID
		
		
		
		Jump to navigation
		Jump to search
		
语法
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