GetAccountsByIP

From Multi Theft Auto: Wiki
Revision as of 22:02, 1 July 2018 by Bonus (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function returns a table containing all accounts that were logged onto from specified IP. ==Syntax== <syntaxhighlight lang="lua">...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function returns a table containing all accounts that were logged onto from specified IP.

Syntax

table getAccountsByIP ( string ip )

OOP Syntax Help! I don't understand this!

Note: This function is a static function underneath the Account class.
Method: Account.getAllByIP(...)


Required Arguments

  • ip: The ip to get accounts from

Returns

Returns table containing the accounts associated with specified ip. 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 ip = getPlayerIP(player)
		local accounts = getAccountsByIP(ip)
		outputChatBox("You have " .. #accounts .. " accounts.", player)
	end)

See Also