GetAccountsByIP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function returns a [[table]] containing all accounts that were logged onto from specified IP-address. | {{New feature/item|3.0156|1.5.5|11747|This function returns a [[table]] containing all accounts that were logged onto from specified IP-address.}} | ||
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
{{OOP|This function is a static function underneath the Account class.|Account.getAllByIP||}} | {{OOP|This function is a static function underneath the Account class.|Account.getAllByIP||}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''ip:''' The IP to get accounts from | *'''ip:''' The IP to get accounts from. | ||
===Returns=== | ===Returns=== | ||
Returns ''[[table]]'' containing the accounts associated with specified | Returns ''[[table]]'' containing the accounts associated with specified IP-address. Returns ''false'' if invalid arguments were specified. | ||
==Example== | ==Example== | ||
This example adds command ''getAccounts'' that outputs the number of accounts a player has in the | This example adds command ''getAccounts'' that outputs the number of accounts a player has in the chatbox: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("getAccounts", | addCommandHandler("getAccounts", | ||
Line 27: | Line 27: | ||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} | ||
[[en:GetAccountsByIP]] | |||
[[ru:getAccountsByIP]] | |||
[[zh-cn:GetAccountsByIP]] |
Latest revision as of 21:27, 23 September 2021
This function returns a table containing all accounts that were logged onto from specified IP-address.
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-address. Returns false if invalid arguments were specified.
Example
This example adds command getAccounts that outputs the number of accounts a player has in the chatbox:
addCommandHandler("getAccounts", function (player, cmd) local ip = getPlayerIP(player) local accounts = getAccountsByIP(ip) outputChatBox("You have " .. #accounts .. " accounts.", player) end)
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