GetAccountSerial: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(OOP syntax added)
m (→‎Syntax: OOP)
Line 10: Line 10:
string getAccountSerial ( account theAccount )
string getAccountSerial ( account theAccount )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[account]]:getSerial|serial|}}
{{OOP|This function is also a static function underneath the Account class.|[[account]]:getSerial|serial|}}
===Required Arguments===  
===Required Arguments===  
*'''theAccount:''' The [[account]] to get serial from
*'''theAccount:''' The [[account]] to get serial from

Revision as of 16:10, 22 August 2014

ADDED/UPDATED IN VERSION 1.4 :

This function returns the last serial that logged onto the specified account.


Syntax

string getAccountSerial ( account theAccount )

OOP Syntax Help! I don't understand this!

Note: This function is also a static function underneath the Account class.
Method: account:getSerial(...)
Variable: .serial


Required Arguments

  • theAccount: The account to get serial from

Returns

Returns string containing the serial, the string is empty if the account was never used. Returns false if invalid arguments were specified.

Example

This example adds command getaccserial that outputs the given account's serial in the chat box.

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

See Also