Skip to content

vehicles.repair

Restores health to 1000 and clears supported engine, panel, light, tyre and door damage on any active networked vehicle. It keeps control settings and open positions, and does not change whether the vehicle is wrecked.

vehicles.repair(id: number): Promise<ActionResult>
Name Type Description
id number The vehicle’s network ID.

A promise of an ActionResult: applied once the server updates its state, rejected for an unknown vehicle, or timeout if the server does not answer within five seconds. If condition changes, the server emits vehicleDamaged with changeSource: "repair".

Repair preserves engine on/off, headlight mode, lock, siren, window positions, and which supported doors, hood or trunk are open. A wrecked vehicle remains wrecked; use your vehicle lifecycle logic if it should be replaced.

gamemodes/my-mode.ts
import { server, vehicles } from "nativemp";
server.on("vehicleDamaged", ({ vehicleId, state }) => {
if ((state.condition?.health ?? 1000) < 250) void vehicles.repair(vehicleId);
});