AR/logIn: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server function}} This functions logs the given player in to the given account. You need to provide the password needed to log into that account. ==Syntax== <syntaxhighlight lang="lua">...")
 
m (Добавление языков)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}
{{Server function}}
This functions logs the given player in to the given account. You need to provide the password needed to log into that account.
هذه الوظيفة تسجل الدخول لـ الاعب الذي تريده , سوف تحتاج كلمة السر التي سوف تسجل الدخول بها للاعب الذي تريده او مع الحدث الذي تريده


==Syntax==  
==Syntax==  
Line 9: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''thePlayer:''' The player to log into an account
*'''thePlayer:''' الاعب الذي تريده أن يسجل الدخول بالحساب الذي تريده
*'''theAccount:''' The account to log the player into
*'''theAccount:''' الحساب الذي تريد الاعب ان يدخل فيه
*'''thePassword:''' The password needed to sign into this account
*'''thePassword:''' كلمة السر التي ستُدخل بها الحساب الذي تريده


===Returns===
===Returns===
Returns ''true'' if the player was successfully logged into the given account. Returns ''false'' or ''nil'' if the log in failed for some reason, ie. the player was already logged in to some account (use [[logOut]] first), if the account was already in use or if it failed for some other reason.
Returns ''true'' if the player was successfully logged into the given account. Returns ''false'' or ''nil'' if the log in failed for some reason, ie. the player was already logged in to some account (use [[logOut]] first), if the account was already in use or if it failed for some other reason.


==Example==  
==مثال==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function loginPlayer ( thePlayer, command, username, password )
function loginPlayer ( thePlayer, command, username, password )
local account = getAccount ( username, password ) -- Return the account
local account = getAccount ( username, password ) --s العودة إلى الحساب
if ( account ~= false ) then -- If the account exists.
if ( account ~= false ) then --s اذا هذا الحساب موجود ثم
logIn ( thePlayer, account, password ) -- Log them in.
logIn ( thePlayer, account, password ) --s ادخلهم في الحساب
else
else --s بطريقة آُخرى
outputChatBox ( "Wrong username or password!", thePlayer, 255, 255, 0 ) -- Output they got the details wrong.
outputChatBox ( "اسم الحساب او كلمة السر التي ادخلتها خاطئة", thePlayer, 255, 255, 0 )
end
end
end
end
addCommandHandler ( "log-in", loginPlayer ) -- Make it trigger for "/log-in", NOTE: /login is hardcored and cannot be used.
addCommandHandler ( "دخول", loginPlayer ) --s نجعلها بكلمة دخول
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==أنظر أيضاً==
{{AR Account_functions}}
{{AR Account_functions}}
[[en:logIn]]
[[en:logIn]]
[[ru:logIn]]
[[ar:logIn]]
[[zh-cn:logIn]]

Latest revision as of 14:09, 12 April 2021

هذه الوظيفة تسجل الدخول لـ الاعب الذي تريده , سوف تحتاج كلمة السر التي سوف تسجل الدخول بها للاعب الذي تريده او مع الحدث الذي تريده

Syntax

bool logIn ( player thePlayer, account theAccount, string thePassword )

Required Arguments

  • thePlayer: الاعب الذي تريده أن يسجل الدخول بالحساب الذي تريده
  • theAccount: الحساب الذي تريد الاعب ان يدخل فيه
  • thePassword: كلمة السر التي ستُدخل بها الحساب الذي تريده

Returns

Returns true if the player was successfully logged into the given account. Returns false or nil if the log in failed for some reason, ie. the player was already logged in to some account (use logOut first), if the account was already in use or if it failed for some other reason.

مثال

function loginPlayer ( thePlayer, command, username, password )
	local account = getAccount ( username, password ) --s العودة إلى الحساب
		if ( account ~= false ) then --s اذا هذا الحساب موجود ثم
			logIn ( thePlayer, account, password ) --s ادخلهم في الحساب
		else --s بطريقة آُخرى
			outputChatBox ( "اسم الحساب او كلمة السر التي ادخلتها خاطئة", thePlayer, 255, 255, 0 )
		end
end
addCommandHandler ( "دخول", loginPlayer ) --s نجعلها بكلمة دخول

أنظر أيضاً