ZH-CN/AclDestroy

From Multi Theft Auto: Wiki
Revision as of 01:59, 6 February 2021 by Qwe7769611 (talk | contribs)
Jump to navigation Jump to search

此函数将销毁传递的ACL.销毁的ACL将不再有效.

语法

bool aclDestroy ( acl theACL )

OOP Syntax Help! I don't understand this!

Method: acl:destroy(...)


必填参数

  • theACL: 要销毁的ACL

返回值

如果成功销毁,则返回“true”;如果无法删除,则返回“false”(意思就是它是一个空值).

示例

此示例显示了删除ACL的命令:

function deleteSomeACL ( thePlayer, cmdname, theACL )
    if aclGet ( theACL ) then --检查指定的ACL是否存在
        --If it does
        local deleted = aclDestroy ( theACL ) --尝试删除ACL
        if deleted then --如果ACL已被删除
            --我们会发送给玩家一个成功删除的消息
            outputChatBox ( "ACL " ..theACL.. " Succesfully removed!", thePlayer )
        else --如果删除时出错
            --我们向玩家发送一条错误消息
            outputChatBox ( "Error while removing ACL " ..theACL.. "!", thePlayer )
        end
    else --如果ACL不存在
        outputChatBox ( "Error: Invalid ACL Name specified, or the ACL doesn't exist.", thePlayer )
    end
end
addCommandHandler ( "deleteACL", deleteSomeACL ) --添加命令处理程序

See Also