AR/getAllAccountData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 10: | Line 10: | ||
*'''theAccount:''' الحساب الذي تريد استرداد كافة البيانات منه | *'''theAccount:''' الحساب الذي تريد استرداد كافة البيانات منه | ||
=== | ===الرد=== | ||
.يحتوي على جميع بيانات الحساب. قد يكون الجدول فارغاً [[table]] جدول | .يحتوي على جميع بيانات الحساب. قد يكون الجدول فارغاً [[table]] جدول | ||
Revision as of 03:58, 28 August 2012
هذه الوظيفة تقوم بالرد بجدول يحتوي على جميع البيانات التي في الحساب
Syntax
table getAllAccountData ( account theAccount )
Required Arguments
- theAccount: الحساب الذي تريد استرداد كافة البيانات منه
الرد
.يحتوي على جميع بيانات الحساب. قد يكون الجدول فارغاً 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'
المتطلبات
This template will be deleted.