Skip to main content

Vehicle::setCeilingHeight

Client-side function

Function​

This function sets the ceiling height for a vehicle, which determines how close the vehicle can get to a ceiling or roof above it. The parameter p1 sets this height, typically in meters.

Required Params​

  • vehicle: number - The vehicle handle to set ceiling height.
  • height: float - The ceiling height for the vehicle.

Return value​

  • void

Syntax​

mp.game.vehicle.setCeilingHeight(vehicleHandle, height);

Example​

// Example: Set a ceiling height of 420.0 for the player's vehicle.
const playerVehicle = mp.players.local.vehicle;
const ceilingHeight = 420.0;

if (playerVehicle) {
mp.game.vehicle.setCeilingHeight(playerVehicle.handle, ceilingHeight);
}