AclDestroy: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> This fake function is for use with blah & blah and does blahblahblabhalb...)
 
mNo edit summary
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function destroys the ACL passed. The destroyed ACL will no longer be valid.


==Syntax==  
==Syntax==  
Line 8: Line 9:
bool aclDestroy ( acl theACL )
bool aclDestroy ( acl theACL )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[acl]]:destroy||}}
===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 -->
<!-- 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 -->
*'''argumentName:''' description
*'''theACL:''' The ACL to destroy
 
<!-- Only include this section below if there are optional arguments -->
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' description
*'''argumentName3:''' description


===Returns===
===Returns===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
<!-- 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 blah, ''false'' otherwise.
Returns ''true'' if successfully destroyed and ''false'' if it could not be deleted (ie. it's not valid).


==Example==  
==Example==  
<!-- Explain what the example is in a single sentance -->
<!-- Explain what the example is in a single sentance -->
This example does...
This example shows you a command to delete an ACL:
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function deleteSomeACL ( thePlayer, cmdname, theACL )
blabhalbalhb --abababa
    if aclGet ( theACL ) then --Check if the specified ACL exists
--This line does this...
        --If it does
mooo
        local deleted = aclDestroy ( theACL ) --Try to delete the ACL
        if deleted then --If the ACL has been deleted
            --We will give the player a succes-message
            outputChatBox ( "ACL " ..theACL.. " Succesfully removed!", thePlayer )
        else --If there was something wrong while deleting
            --We send the player an error message
            outputChatBox ( "Error while removing ACL " ..theACL.. "!", thePlayer )
        end
    else --If the ACL doesn't exists
        outputChatBox ( "Error: Invalid ACL Name specified, or the ACL doesn't exist.", thePlayer )
    end
end
addCommandHandler ( "deleteACL", deleteSomeACL ) --Add the commandhandler
</syntaxhighlight>
</syntaxhighlight>


Line 37: Line 44:
<!-- 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 -->
{{ACL_functions}}
{{ACL_functions}}
[[Category:Incomplete]] -- leave this unless you complete the function
 
[[ar:aclDestroy]]
[[en:AclDestroy]]
[[zh-cn:AclDestroy]]

Latest revision as of 18:15, 21 February 2021

This function destroys the ACL passed. The destroyed ACL will no longer be valid.

Syntax

bool aclDestroy ( acl theACL )

OOP Syntax Help! I don't understand this!

Method: acl:destroy(...)


Required Arguments

  • theACL: The ACL to destroy

Returns

Returns true if successfully destroyed and false if it could not be deleted (ie. it's not valid).

Example

This example shows you a command to delete an ACL:

function deleteSomeACL ( thePlayer, cmdname, theACL )
    if aclGet ( theACL ) then --Check if the specified ACL exists
        --If it does
        local deleted = aclDestroy ( theACL ) --Try to delete the ACL
        if deleted then --If the ACL has been deleted
            --We will give the player a succes-message
            outputChatBox ( "ACL " ..theACL.. " Succesfully removed!", thePlayer )
        else --If there was something wrong while deleting
            --We send the player an error message
            outputChatBox ( "Error while removing ACL " ..theACL.. "!", thePlayer )
        end
    else --If the ACL doesn't exists
        outputChatBox ( "Error: Invalid ACL Name specified, or the ACL doesn't exist.", thePlayer )
    end
end
addCommandHandler ( "deleteACL", deleteSomeACL ) --Add the commandhandler

See Also