@name CopAutoDoor
@persist Holder:entity
@outputs A
findByClass("player")
Player=findClosest(entity():pos())
if (!Holder & ((Player:isAuthorisedPersonnel() & Player:team()!=17) | Player:isPoliceDeputy() | Player:isMayorAssistant()) & Player:keyUse() & Player:aimEntity()==entity():isWeldedTo()) {
    Holder=Player
    A=1
} elseif (Holder & !Holder:keyUse()) {A=0 Holder=noentity()}
if (first()) {
    local Door=entity():isWeldedTo()
    Door:createWire(entity(),"Fade","A")
}
interval(100)
