AR/getAllAccountData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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 getAllAccountData ( account theAcco...")
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server function}}
{{Server function}}
This function returns a table containing all the user data for the account provided
هذه الوظيفة تقوم بالرد بجدول يحتوي على جميع البيانات التي في الحساب
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 8: Line 8:


===Required Arguments===  
===Required Arguments===  
*'''theAccount:''' The account you wish to retrieve all data from.
*'''theAccount:''' الحساب الذي تريد استرداد كافة البيانات منه


===Returns===
===Returns===
A [[table]] containing all the user data. This table might be empty.
.يحتوي على جميع بيانات الحساب. قد يكون الجدول فارغاً [[table]] جدول


==Example==
==Example==
Line 32: Line 32:
</syntaxhighlight>
</syntaxhighlight>


==Requirements==
==المتطلبات==
{{Requirements|1.3.0-9.03804|n/a|}}
{{Requirements|1.3.0-9.03804|n/a|}}


==See Also==
==انظر ايضاً==
{{AR Account functions}}
{{AR Account functions}}


[[en:addAcount]]
[[en:addAcount]]

Revision as of 03:58, 28 August 2012

هذه الوظيفة تقوم بالرد بجدول يحتوي على جميع البيانات التي في الحساب

Syntax

table getAllAccountData ( account theAccount )

Required Arguments

  • theAccount: الحساب الذي تريد استرداد كافة البيانات منه

Returns

.يحتوي على جميع بيانات الحساب. قد يكون الجدول فارغاً table جدول

Example

function printAllData ( thePlayer )
    local playerAccount = getPlayerAccount( thePlayer ) -- get his account
    if ( playerAccount ) then -- if we got the account then
        local data = getAllAccountData( 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'

المتطلبات

Minimum server version 1.3.0-9.03804
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.3.0-9.03804" />

انظر ايضاً