GetAllAccountData

From Multi Theft Auto: Wiki
Revision as of 18:39, 30 January 2012 by OpenIDUser34 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function returns a table containing all the user data for the account provided ==Syntax== <syntaxhighlight lang="lua"> table getAccountAllData ( account theAcco...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns a table containing all the user data for the account provided

Syntax

table getAccountAllData ( account theAccount )

Returns

A table containing all the user data. This table might be empty.

Example

function printAllData ( thePlayer )
    local playerAccount = getPlayerAccount( thePlayer ) -- get his account
    if ( playerAccount ) then -- if we got the account then
        local data = getAccountAllData( playerAccount ) -- get data
        count = 0
        for _ in pairs(data) do count = count + 1 end -- get the count
        outputChatBox ( "table holds " .. count .. " entries" ) -- output number of rows
        if ( data ) then
            for k,v in pairs ( data ) do
                outputChatBox(k..": "..v) -- print the key and value of each entry of data
            end
        end
    end
end
addCommandHandler( "getall", printAllData ) -- add a command handler for command 'getall'

See Also