GetAccounts: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				mNo edit summary  | 
				||
| Line 8: | Line 8: | ||
===Returns===  | ===Returns===  | ||
A [[table]] over the accounts that exist in the server   | A [[table]] over the accounts that exist in the server internal.db file. This table might be empty.  | ||
==Example==  | ==Example==  | ||
Revision as of 12:27, 21 June 2011
This function returns a table over all the accounts that exist in the server internal.db file. (Note: accounts.xml is no longer used after version 1.0.4)
Syntax
table getAccounts ()
Returns
A table over the accounts that exist in the server internal.db file. This table might be empty.
Example
function printAmountOfAccounts ( thePlayer )
    local accountTable = getAccounts () -- return the table over accounts
    if #accountTable == 0 then -- if the table is empty
        outputChatBox( "There are no accounts. :(", thePlayer )
    else -- table isn't empty
        outputChatBox( "There are " .. #accountTable .. " accounts in this server!", thePlayer )
    end
end
addCommandHandler( "accountcount", printAmountOfAccounts ) -- add a command handler for command 'accountcount'
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