Stuyk/rebar-altv

function toggleDoor(door: number)

Closed this issue · 2 comments

The function toggleDoor currently just opens a door of a vehicle but it cant close it.

The used function .getDoorState(door) always returns 0

    /**
     * Toggle door state for the given vehicle
     *
     * 0 - Driver
     * 1 - Passenger
     * 2 - Back Left
     * 3 - Back Right
     * 4 - Hood
     * 5 - Trunk
     *
     * @param {number} door
     */
    function toggleDoor(door: number) {
        vehicle.setDoorState(door, vehicle.getDoorState(door) === 0 ? 7 : 0);
    }

Currently a altv bug:

altmp/altv-issues#737

Should be resolved in #132 with a small override