AclGroupRemoveACL: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}  
{{Server function}}
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This function removes the given ACL from the given ACL group.
This function removes the given ACL from the given ACL group. ('''Please NOTE:''' that the resource that's using this function needs the right to remove an acl.)
{{Note|The resource that's using this function needs the right to remove an acl.}}


==Syntax==  
==Syntax==
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool aclGroupRemoveACL ( aclgroup theGroup, acl theACL )
bool aclGroupRemoveACL ( aclgroup theGroup, acl theACL )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[aclgroup]]:removeACL||}}
===Required Arguments===  
===Required Arguments===
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
*'''theGroup:''' The group to remove the given ACL from
*'''theGroup:''' The group to remove the given ACL from
*'''theACL:''' The ACL to remove from the given group
*'''theACL:''' The ACL to remove from the given group


===Returns===
===Returns===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
Returns ''true'' if the ACL was successfully removed from the ACL group, ''false''/''nil'' if it could not be removed for some reason, ie. either of the elements were invalid.
Returns ''true'' if the ACL was successfully removed from the ACL group, ''false''/''nil'' if it could not be removed for some reason, ie. either of the elements were invalid.


==Example==  
==Example==
This example outputs to the console if the Admin acl was removed from the Moderator ACL Group.
This example outputs to the console if the Admin acl was removed from the Moderator ACL Group. (TESTED!)
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
if(aclGroupRemoveACL(aclGetGroup("Moderator"),aclGet("Admin")))then
if(aclGroupRemoveACL(aclGetGroup("Moderator"),aclGet("Admin")))then
Line 32: Line 29:


==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{ACL_functions}}
{{ACL_functions}}
[[zh-cn:aclGroupRemoveACL]]

Latest revision as of 08:35, 5 February 2021

This function removes the given ACL from the given ACL group.

[[{{{image}}}|link=|]] Note: The resource that's using this function needs the right to remove an acl.

Syntax

bool aclGroupRemoveACL ( aclgroup theGroup, acl theACL )

OOP Syntax Help! I don't understand this!

Method: aclgroup:removeACL(...)


Required Arguments

  • theGroup: The group to remove the given ACL from
  • theACL: The ACL to remove from the given group

Returns

Returns true if the ACL was successfully removed from the ACL group, false/nil if it could not be removed for some reason, ie. either of the elements were invalid.

Example

This example outputs to the console if the Admin acl was removed from the Moderator ACL Group. (TESTED!)

addEventHandler("onResourceStart",resourceRoot,function()
	if(aclGroupRemoveACL(aclGetGroup("Moderator"),aclGet("Admin")))then
		aclSave()
		outputConsole("The Admin acl was removed from the Moderator group.")-- If it was successfully removed
	else
		outputConsole("Unsuccessful... Admin might have been removed from the Moderator group before.")-- if it was removed before or didn't existed
	end
end)	

See Also