AR/banPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{Server function}}
{{Server function}}
{{New feature|3|1.0|
{{New feature|3|1.0|
هذه الوظيفة سـ تبند الاعب المحدد عن طريق كلٍٍ من الاي بي او السيريال او اسم الاعب
هذه الوظيفة سـ تبند الاعب المحدد عن طريق كل من الاي بي او السيريال او اسم الاعب
}}
}}


{{Deprecated_feature|3|1.0|
{{Deprecated_feature|3|1.0|
This function will ban the specified player from the server by IP.
This function will ban the specified player from the server by IP.|AR
}}
}}


Line 20: Line 20:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         
bool banPlayer ( player bannedPlayer , [ element responsibleElement, string reason ] )         
</syntaxhighlight>
</syntaxhighlight>|AR
}}
}}


Line 42: Line 42:
getRootElement()
getRootElement()


( الحد الأقصى 30 حرف )
*'''reason:''' ( الحد الاقصى 30 حرف )t سبب حظر اللاعب من السيرفر
*'''reason:''' سبب الحظر الاعب من السيرفر
*'''seconds:''' عدد الثواني الذي سيتم بها الحظر الاعب , 0 اذا كان الباند دائم
*'''seconds:''' عدد الثواني الذي سيتم بها الحظر الاعب , 0 اذا كان الباند دائم


===Returns===
===Returns===
{{Deprecated_feature|3|1.0|
{{Deprecated_feature|3|1.0|
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.
Returns ''true'' if the player was banned succesfully, ''false'' if invalid arguments are specified.|AR
}}
}}



Latest revision as of 21:03, 14 June 2021

هذه الوظيفة سـ تبند الاعب المحدد عن طريق كل من الاي بي او السيريال او اسم الاعب

Syntax

ban banPlayer ( player bannedPlayer, [ bool IP = true, bool Username = false, bool Serial = false, 
player responsiblePlayer = nil, string reason = nil, int seconds = 0 ] )

Required Arguments

  • bannedPlayer: الاعب الذي سيتم تحظر دخوله من السيرفر.

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.

  • IP: هل سيكون الحظر عن طريق الاي بي ؟
  • Username: هل سيكون الحظر عن طريق الاسم ؟
  • Serial: هل سيكون الحظر عن طريق السيريال
ملاحظة: t للتبنيد عن طريق الاسم او السيريال

verifyserials

يجب ان تكون مفتوحة في ملف ترتيب السيرفر

  • responsibleElement: الشيء الذي سيكون مسؤل عن الحظر , يمكنه ان يكون لاعب , ويمكنه ان يكون

getRootElement()

  • reason: ( الحد الاقصى 30 حرف )t سبب حظر اللاعب من السيرفر
  • seconds: عدد الثواني الذي سيتم بها الحظر الاعب , 0 اذا كان الباند دائم

Returns

Returns a ban object if banned successfully, or false if unsuccessful.

مثال

المثال يدع الاعبين يبندون كما يشاؤن اذا كان لهم صلاحية الادمن في ملف اي اس ال

ACL

 -- السبب, اسم الباند ,اسم الكلمة التي سيتم بها تبنيد الاعب , الاعب
function banPlayerCommand ( theClient, commandName, bannedName, reason )
	-- يعطي الاعب خطاء اذا لم يكن له الصلاحية لفعل ذلك
	if ( hasObjectPermissionTo ( theClient, "function.banPlayer" ) ) then
		-- يتحقق من اسم الاعب الذي سيتم تبنيده من قبل الادمن الذي سيكتب الكلمة واسمه
		local bannedPlayer = getPlayerFromName ( bannedName )
		-- تبنيد الاعب
		banPlayer ( bannedPlayer, theClient, reason )
                -- يخبر بالشات بآنه تم تبنيد هذا الاعب بنجاح
		outputChatBox ( "ban: " .. bannedName .. " successfully banned", theClient )
                -- اذا ليس كذلك
	else
                -- يخرج بالشات بآن الاعب الذي كتب الكلمة ليس معه الصلاحية الكافية للتبنيد
		outputChatBox ( "ban: You don't have enough permissions", theClient )
	end

end
addCommandHandler ( "ban", banPlayerCommand )
--[[ لقد جعلنا كلمة
ban
تفعل كل ما كتبناه فوق
]]

انظر أيضاً