AR/aclDestroyGroup: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
Line 46: Line 46:
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{AR/ACL_functions}}
{{AR/ACL_functions}}
[[ar:aclDestroyGroup]]
[[en:AclDestroyGroup]]
[[zh-cn:AclDestroyGroup]]

Latest revision as of 18:17, 21 February 2021

. "ACL" تعمل هذه الوظيفة على حذف جروب من الـ

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

bool aclDestroyGroup ( aclgroup aclGroup )

الفراغات المطلوبة :

  • aclGroup: إسم القروب الذي تود حذفه من الأسل .

المعطيات :

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

مثال :

This example allows admins to remove an ACL group they specify.

function removeACLGroup ( source, command, groupName )
-- Check if they're an admin...
	if ( isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source )), aclGetGroup ( "Admin" ) ) ) then
		if ( groupName ) then -- Check if they specified the group name
			local group = aclGetGroup ( groupName ) -- Return any groups matching the name
				if ( group ) then -- If any were returned then...
					aclDestroyGroup ( group ) -- Destroy that group
				else
					-- Tell them if no groups with that name were found...
					outputChatBox ( "No group with that name was found.", source, 255, 0, 0 )
				end
	
		else -- If they didn't specify the group
			outputChatBox ( "Please specify the group name.", source, 255, 0, 0 ) -- Tell them that they must
		end
	else -- If they're not an admin....
		outputChatBox ( "You must be an admin to use this command", source, 255, 0, 0 ) -- Tell them it's restricted
	end
end
addCommandHandler ( "removeACL", removeACLGroup ) -- Make it happen when somebody types "/removeACL"

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

See Also