export default function door() {
    mp.events.add("CLIENT:SetDoorOpen", (door, lose, permanent) => {
        var vehicle = mp.players.local.vehicle;
        if (vehicle && mp.vehicles.exists(vehicle)) {
            vehicle.setDoorOpen(door, lose, permanent);
        }
    });
    mp.events.add("CLIENT:SetDoorShut", (door, permanent) => {
        var vehicle = mp.players.local.vehicle;
        if (vehicle && mp.vehicles.exists(vehicle)) {
            mp.players.local.vehicle.setDoorShut(door, permanent);
        }
    });
    mp.events.add("CLIENT:SetDoorShutDelayed", (door, permanent, time) => {
        setTimeout(function () {
            var vehicle = mp.players.local.vehicle;
            if (vehicle && mp.vehicles.exists(vehicle)) {
                vehicle.setDoorShut(door, permanent);
            }
        }, time)
    });
}