valid
Used to get
if the vehicle if currently valid and can be destroyed.
Returns a boolean
.
Declaration
vehicle.valid: boolean;
Usage
const isValid = vehicle.valid;
Real World Example
const vehicle = new alt.Vehicle('elegy', 0, 0, 0, 0, 0, 0);
if (vehicle && vehicle.valid) {
vehicle.destroy();
}
These examples assume you have vehicle created or available on server-side