AmyrAhmady / omp-node

[WIP] open.mp nodejs component to write your scripts in TS/JS
9 stars 1 forks source link

Player put in vehicle #4

Open adriantandara opened 1 day ago

adriantandara commented 1 day ago

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
})