Vehicle::destroy
This functions destroys a vehicle.
Syntax
Vehicle vehicle.destroy()
Example
Destroys a random vehicle from command.
mp.events.add('playerCommand', (player, cmd) => {
let arr = cmd.split(' ');
if (arr[0] == 'destroyrandomveh' && player.vehicle) {
let vehicles = mp.vehicles.toArray();
let randomValue = Math.floor(Math.random() * vehicles.length);
vehicles[randomValue].destroy();
}
});