AR/getAccount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Добавление языков)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server function}}
{{Server function}}
This function returns an account for a specific user.
هذه الوظيفة ترجع لحساب الاعب الاعب المحدد
==Syntax==
==التكوين==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
account getAccount ( string username, [ string password ] )
account getAccount ( string username, [ string password ] )
Line 8: Line 8:


===Required Arguments===
===Required Arguments===
*'''username:''' The username of the account you want to retrieve
*'''username:''' اسم الحساب الذي تريد استرداده


===Optional Arguments===
===Optional Arguments===
{{OptionalArg}}
{{OptionalArg}}
*'''password:''' The password for the account. If this argument is not specified, you can get the account whatever password it is, otherwise the password must match the account's.
*'''password:''' كلمة سر الحساب . يمكنك ان تضع هذه البرهان اذا كنت تعرف كلمة السر الحساب الذي تريده , بطريقة أُخرى كلمة السر يجب ان تكون مطابقة للحساب


===Returns===
===Returns===
An ''account'' value or ''false'' if an account matching the username specified (and password, if specified) could not be found.
An ''account'' value or ''false'' if an account matching the username specified (and password, if specified) could not be found.


==Example==
==مثال==
<syntaxhighlight lang="lua">addEventHandler("onPlayerJoin",root,function()
<syntaxhighlight lang="lua">addEventHandler("onPlayerJoin",root,function()
     if getAccount(getPlayerName(source)) then
     if getAccount(getPlayerName(source)) then
Line 27: Line 27:
</syntaxhighlight>
</syntaxhighlight>


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


[[en:getAccount]]
[[en:getAccount]]
[[ru:getAccount]]
[[ar:getAccount]]
[[es:getAccount]]
[[es:getAccount]]
[[pl:GetAccount]]
[[pl:GetAccount]]
[[ru:GetAccount]]
[[zh-cn:getAccount]]

Latest revision as of 19:50, 11 April 2021

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

التكوين

account getAccount ( string username, [ string password ] )

Required Arguments

  • username: اسم الحساب الذي تريد استرداده

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • password: كلمة سر الحساب . يمكنك ان تضع هذه البرهان اذا كنت تعرف كلمة السر الحساب الذي تريده , بطريقة أُخرى كلمة السر يجب ان تكون مطابقة للحساب

Returns

An account value or false if an account matching the username specified (and password, if specified) could not be found.

مثال

addEventHandler("onPlayerJoin",root,function()
    if getAccount(getPlayerName(source)) then
        outputChatBox("Please Login!",source)
    else
        outputChatBox("Please Register!",source)
    end
end)

انظر ايضاً