GetAccountsBySerial

From Multi Theft Auto: Wiki
Revision as of 11:15, 17 April 2014 by Miki785 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} {{New items|4.0132|1.4| This function returns a table containing all accounts that were logged onto from specified serial. If the serial is...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.4 :

This function returns a table containing all accounts that were logged onto from specified serial. If the serial is empty string, it will return all accounts that were never logged onto.


Syntax

table getAccountsBySerial ( string serial )

Required Arguments

  • serial: The serial to get accounts from

Returns

Returns table containing the accounts associated with specified serial. Returns false if invalid arguments were specified.

Example

This example adds command getAccounts that outputs the number of accounts a player has in the chat box.

addCommandHandler("getAccounts", 
	function (player, cmd)
		local serial = getPlayerSerial(player)
		local accounts = getAccountsBySerial(serial)
		outputChatBox("You have " .. #accounts .. " accounts.", player)
	end)

See Also