AR/getAccounts: 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 over all the accounts that exist in the server internal.db file. (Note: accounts.xml is no longer used after version ...")
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server function}}
{{Server function}}
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)
internal.db هذه الوظيفة تقوم بالرد بجدول يحتوي على جميع الحسابات الموجودة في السيرفر في الملف
 
(1.0.4 لم يعد يستخدم في الأصدارات الأحدث من accounts.xml ملاحظة: الملف)
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
table getAccounts ()
table getAccounts()
</syntaxhighlight>
</syntaxhighlight>


===Returns===
===Returns===
A [[table]] over the accounts that exist in the server internal.db file. This table might be empty.
قد يكون الجدول فارغاً . internal.db يحتوي على جميع الحسابات الموجودة في السيرفر في الملف [[table]] جدول


==Example==
==مـــثال==
يستخدم هذا المثال في معرفة عدد الحسابات المسجلة في السيرفر
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function printAmountOfAccounts ( thePlayer )
function printAmountOfAccounts(thePlayer)
     local accountTable = getAccounts () -- return the table over accounts
     local accountTable = getAccounts() -- الجدول الذي يحتوي على الحسابات
     if #accountTable == 0 then -- if the table is empty
     if #accountTable == 0 then -- إذا كان الجدول فارغاً
         outputChatBox( "There are no accounts. :(", thePlayer )
         outputChatBox("There are no accounts. :(", thePlayer)
     else -- table isn't empty
     else -- إذا كان الجدول غير فارغاً
         outputChatBox( "There are " .. #accountTable .. " accounts in this server!", thePlayer )
         outputChatBox("There are "..#accountTable.." accounts in this server!", thePlayer)
     end
     end
end
end
addCommandHandler( "accountcount", printAmountOfAccounts ) -- add a command handler for command 'accountcount'
addCommandHandler("accountcount", printAmountOfAccounts) -- نظيف امر جديد وهو 'accountcount'
</syntaxhighlight>
</syntaxhighlight>


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


[[ar:addAcount]]
[[ar:addAcount]]

Latest revision as of 23:30, 26 September 2016

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

(1.0.4 لم يعد يستخدم في الأصدارات الأحدث من accounts.xml ملاحظة: الملف)

Syntax

table getAccounts()

Returns

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

مـــثال

يستخدم هذا المثال في معرفة عدد الحسابات المسجلة في السيرفر

function printAmountOfAccounts(thePlayer)
    local accountTable = getAccounts() -- الجدول الذي يحتوي على الحسابات
    if #accountTable == 0 then -- إذا كان الجدول فارغاً
        outputChatBox("There are no accounts. :(", thePlayer)
    else -- إذا كان الجدول غير فارغاً
        outputChatBox("There are "..#accountTable.." accounts in this server!", thePlayer)
    end
end
addCommandHandler("accountcount", printAmountOfAccounts) -- نظيف امر جديد وهو 'accountcount'

انظر ايضاً