ZH-CN/getAccountSerial: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Добавление языков)
 
Line 38: Line 38:


[[ru:getAccountSerial]]
[[ru:getAccountSerial]]
[[en:getAccountSerial]]
[[en:getAccountSerial]]
[[zh-cn:getAccountSerial]]

Latest revision as of 13:04, 12 April 2021

此函数返回上次登录到指定账户account的序列serial


语法

string getAccountSerial ( account theAccount )

OOP 语法 什么是OOP?

方法: account:getSerial(...)
变量: .serial

Required Arguments

  • theAccount: 要从中获取序列号的帐户

返回值

返回包含序列号的“字符串”,如果从未使用过帐户,则该字符串为空。如果指定了无效参数,则返回“false”.

示例

此示例添加命令“getaccserial”,该命令在聊天框中输出给定帐户的序列号.

addCommandHandler("getaccserial", 
   function (player, cmd, accountName)
      if accountName then 
	 local account = getAccount(accountName)
	 if (account) then
	     outputChatBox("Serial: " .. getAccountSerial(account))
	 else
	     outputChatBox("Account not found")
	 end
     end
 end
)

See Also