From Multi Theft Auto: Wiki
Revision as of 10:19, 28 April 2020 by ^iiEcoo'x ) (talk | contribs) (Created page with "__NOTOC__ {{Server function}} <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> تقوم هذه الوظيفة بجل...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

تقوم هذه الوظيفة بجلب سماحية أحد الخواص في الأسل .

تركيب الوظيفة :

bool aclGetRight ( acl theAcl, string rightName )

العناصر المطلوبة :

  • theAcl: الأسل الموجود فيه الخاصية
  • rightName: إسم الخاصية المراد جلب سماحيتها .

المعطيات :

بسبب خطأ في العناصرالمطلوبة nil حسب سماحية الخاصية , و تقوم بإرجاع قيمة true , false تقوم بإرجاع قيمة

أمثلة :

This example lets players check if an ACL group has access to something or not.

--theACL examples: Admin, Default, Moderator
--theRight examples: command.debugscript, function.banPlayer

function aclRightCheck(player, command, theACL, theRight)
	if (theACL and theRight) then -- Make sure atleast two arguments were entered.
		local theACL = aclGet(theACL) -- If theACL exists then convert it into an ACL pointer from a string.
		if (theACL) then -- If the ACL was found.
			local theReturn = aclGetRight(theACL, theRight) -- Will return true if it was found in the ACL.
			outputChatBox("The ACL right was found and returned: "..tostring(theReturn), player, 0, 255, 0)
			outputChatBox("The ACL you entered was not found to exist in the ACL file.", player, 255, 0, 0) -- When the ACL was not found.
		outputChatBox("You need to enter an ACL, and a right name.", player, 255, 0, 0) -- When 2 arguements weren't entered.
addCommandHandler("aclgetright", aclRightCheck) -- When a player does the aclgetright command it calls aclRightCheck function above.
-- Example of use: /aclgetright Admin command.debugscript (this should return true)
-- Example of use: /aclgetright Default command.debugscript (this should return false)

إضافة و إعادة ترجمة من قبل : ^iiEcoo'x_)

See Also