GetDoorState
The GetDoorState
export retrieves the current door state of a specified vehicle, providing essential information for vehicle-related interactions or logic. The export returns an integer that corresponds to various door states.
Door State Values
The door state values and their meanings are as follows:
0: None
1: Unlocked
2: Locked
3: LockedForPlayer
4: StickPlayerInside
7: CanBeBrokenInto
8: CanBeBrokenIntoPersist
10: CannotBeTriedToEnter
Other values: Unknown Status
How to Use
To retrieve the door state of a vehicle, use the following code:
This export takes the vehicle entity as a parameter and returns its door state.
Example Usage
This example checks the door state of the nearest vehicle and performs logic based on the state:
This export is highly useful for managing vehicle interactions, security, and gameplay logic tied to door states.
Last updated