اليوم بشرح الوضائف الجديدة الخاصة بالاكاونت { getAccountByID , getAccountID , getAccountIP , getAccountsByData , getAccountsByIP , setAccountName }
بسم الله نبدأ
x[ getAccountByID ]x
شرح الوضيفة \ Explain the function
This function returns the account with the specific ID. / تقوم الوضيفة بإرجاع الحساب عبر الايدي او المعرف الخآص به
السانتكس \ Syntax
account getAccountByID ( int id )
id = The ID to get account from / الآيدي الي تبي تجلب فيه الحساب عن طريقة
العائدات / Returns
Returns account associated with specified ID. Returns false if invalid arguments were specified or there is no account with this ID. / ارجاع الحساب المرتبط بالمعرف او الإيدي ,إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود
مثآل \ Examble
addCommandHandler("getAccount", -- نسوي امر جديد
function (player, cmd, id)
id = tonumber(id) -- نجلب الايدي من الامر
local account = getAccountByID(id) -- نجيب الحساب من الايدي
if account then -- نتحقق ان الحساب موجود او لا
outputChatBox("The name of the account with that ID is: "..getAccountName(account), player) -- اخراج نص بـ أسم الحساب الي جبناه
else -- اذا الحساب مو موجود
outputChatBox("There is no account with this ID.", player) -- اخراج نص بـ ان لا يوجد حساب يمتلك هذا الاي دي
end
end)
x[ getAccountID ]x
شرح الوضيفة \ Explain the function
This function retrieves the ID of an account. / تستخدم هذه الوضيفة لجلب الآيدي او المعرف الخاص بالحساب
السانتكس \ Syntax
int getAccountID ( account theAccount )
theAccount = The account you wish to get the ID of. / الحساب الذي تريد جلب الآيدي او المعرف الخاص به
العائدات / Returns
Returns a int containing the account's ID, false if the account does not exist or an invalid argument was passed to the function. / ارجاع رقم انتقر او رقم صحيح يحتوي ع ايدي الحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود
مثآل \ Examble
function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / لما الاعب يسجل دخول
outputConsole("["..getAccountID(previous_account).."] "..getAccountName(previous_account).." Logged into ["..getAccountID(current_account).."]"..getAccountName(current_account)) -- announce it into the console / استخراج نص للكونسل بـ أيدي حسابة القديم و الجديد
end
addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث
x[ getAccountIP ]x
شرح الوضيفة \ Explain the function
This function retrieves the IP-address of an account. / تستخدم هذي الوضيفة لجلب عنوان الايبي ادريسس للحساب المحدد
السانتكس \ Syntax
string getAccountIP ( account theAccount )
theAccount = The account you wish to get the IP of. / الحساب الذي تريد جلب الايبي ادريسس الخاص به
العائدات / Returns
Returns a string containing the account's IP, false if the account does not exist or an invalid argument was passed to the function. / إرجاع سلسلة نصية تحتوي على عنوان الايبي ادريسس للحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود
مثآل \ Examble
function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / عند تسجيل دخول الاعب
outputDebugScript(getPlayerName(source).."logged into his account with IP "..getAccountIP(previous_account)) -- announce it into the debugscript / إخراج نص للدي بق بـ عنوان الاإيبي ادريس للحساب إو الاعب
end
addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث
x[ getAccountsByData ]x
شرح الوضيفة \ Explain the function
This function returns a table containing all accounts with specified dataName and value (set with setAccountData). / تقوم هذه الوضيفة بإرجاع جدول يحتوي على جميع الحسابات التي تمتلك على داتا محددة
( setAccountData ) :تم تعينها بإستخدام وضيفة
السانتكس \ Syntax
table getAccountsByData ( string dataName, string value )
dataName = The name of the data / اسم الداتا
value = The value the dataName should have / اشتراط ان تكون قيمة الداتا
العائدات / Returns
Returns table containing the accounts associated with specified value at dataName. Returns false if invalid arguments were specified. / جدول يحتوي على الحسابات المرتبطة بالقيمة المحددة في الداتا, إرجاع قيمة منطقية بـ فولس إذا تم تحديد ارقمنات غير صالحة
مثآل \ Examble
addCommandHandler("accountsbydata", function (player) -- add Command / إضافة امر
local account = getPlayerAccount(player) -- Set the variable to the player account / تعين المتغير بـ حساب الاعب
setAccountData(account, "test", "hello") -- Set the data and the value set on the account / وضع داتا معينة وقيمة لها على الحساب
local accounts = getAccountsByData("test", "hello") -- Set the variable to the table containing the accounts associated with dataName and valueData / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالداتا والقيمة الخاصة بها
outputChatBox(getAccountName(accounts[1]), player) -- The output text that contains the first account in the table / إخراج نص يحتوي على إول حساب في الجدول
end)
x[ getAccountsByIP ]x
شرح الوضيفة \ Explain the function
This function returns a table containing all accounts that were logged onto from specified IP-address. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على كافة الحسابات التي تم تسجيلها من عنوان الإيبي ادريس المحدد
السانتكس \ Syntax
table getAccountsByIP ( string ip )
ip = The IP to get accounts from / الإيبي ادريس المراد الحصول على الحسابات المسجلة به
العائدات / Returns
Returns table containing the accounts associated with specified IP-address. Returns false if invalid arguments were specified. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على الحسابات المرتبطة بعنوان الايبي ادريس المحدد, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة
مثآل \ Examble
addCommandHandler("getAccounts", -- add Command / إضافة امر
function (player, cmd)
local ip = getPlayerIP(player) -- Set the variable to the player IP / تعين المتغير بـ إيبي الاعب
local accounts = getAccountsByIP(ip) -- Set the variable to the table containing the accounts associated with IP / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالإيبي المسجل بها
outputChatBox("You have " .. #accounts .. " accounts.", player) -- Output text in the number of recorded accounts in player IP-address / إخراج نص بعدد الحسابات المسجلة في إيبي ادريس الاعب
end)
x[ setAccountName ]x
شرح الوضيفة \ Explain the function
This function sets the name of an account. / تقوم هذه الوضيفة بتحديد اسم الحساب المحدد
السانتكس \ Syntax
bool setAccountName ( account theAccount, string name [, bool allowCaseVariations = false] )
theAccount = The account you wish to change the name./الحساب الذي تريد تعين الاسم له
name = The new name.. / الإسم الجديد للحساب
allowCaseVariations = Whether the username is case sensitive (if this is set to true, usernames "Bob" and "bob" will refer to different accounts)
العائدات/ Returns
Returns a true if the account name was set, false if an invalid argument was specified. / تقوم هذه الوضيفة بإرجاع قيمة منطقية بـ ترو إذا تم تعين اسم الحساب, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة
مثآل \ Examble
addCommandHandler("changeaccountname", function(player, _, oldname, newname) -- add Command / اضافة امر
if not oldname or not newname then -- Verify that the oldname and newname value exist / تحقق من وجود قيمة oldname و newname
return
end
local account = getAccount(oldname)-- Set the variable to the account whose name will be changed / تعين المتغير بـ الحساب المراد تغير اسمه
if not account then -- Verify that the specified account exists / تحقق من وجود الحساب المحدد
return
end
setAccountName(account, newname) -- Set the specified account name to the newname / وضع إسم الحساب المحدد إلى الـ newname
end)
الحمد لله وصلنآ إلى نهاية الشرح إتمنى انه اعجبكم وماكان صعب عليكم
الإهداءات/ Dedications
@KhaledAlamri
@#َxLysandeR
@!#NssoR_)
@#_iMr,[E]coo
@#StrOnG_,)
@iMr.WiFi..!
@بويكا
@Master_MTA
@N3xT
@#DRAGON!FIRE
@[T]|O|[P]George
@MrKAREEM
@ccz
@killerProject
@#DesTroeyR
@Rakan#
@الباقي بالقلب