I am trying to spawn a vehicle; it spawns successfully, but when I put the player in the vehicle, the server crashes using the command player.putInVehicle, as shown in the example below:
import { omp, Player, Vehicle } from '@open.mp/node';
omp.on('playerCommandText', (player: Player, command: string) => {
if (command !== "vehicle") return;
const vehicle = new Vehicle(411, player.getPos().x, player.getPos().y, player.getPos().z, player.getFacingAngle(), -1, -1, -1, false);
player.putInVehicle(vehicle, 0); // here is problem, server crashes
})
I am trying to spawn a vehicle; it spawns successfully, but when I put the player in the vehicle, the server crashes using the command
player.putInVehicle
, as shown in the example below: