YaVehicleAPI
YaVehicleAPI manges vehicles, drivers, and trigger events in the gameFunctions
void YaVehicleAPI.SetHandBrake(YaEntity vehicleEntity, boolean isHandBrake)
Sets the handbrake state of a vehicle. Disabled by default. When the handbrake is on, the vehicle's speed gradually decreases to zero
vehicleEntityThe target vehicle entityisHandBrakeWhether the handbrake is enabled
void YaVehicleAPI.SetAcceleration(YaEntity vehicleEntity, boolean isAcceleration)
Sets the acceleration state of a vehicle. Disabled by default. When acceleration is on, the vehicle's speed increases
vehicleEntityThe target vehicle entityisAccelerationWhether speed acceleration is enabled
void YaVehicleAPI.SetEnable(YaEntity vehicleEntity, boolean enable)
Sets whether a vehicle receives player inputs. Disabled by default. When enabled, the vehicle receives player inputs.
vehicleEntityThe target vehicle entityenableWhether to enable receiving player inputs
boolean YaVehicleAPI.GetEnable(YaEntity vehicleEntity)
vehicleEntityThe target vehicle entity
YaEntity YaVehicleAPI.GetDriverByVehicle(YaEntity vehicleEntity)
vehicleEntityThe target vehicle entity
YaEntity YaVehicleAPI.GetVehicleByDriver(YaEntity driverEntity)
driverEntityThe target driver entity
void YaVehicleAPI.SetDriver(YaEntity vehicle, YaEntity driver, float3 position)
Sets a vehicle's driver and their position to the vehicle
vehicleThe target vehicle entitydriverThe target driver entity that controls the vehiclepositionThe offset of the driver in the vehicle's local transform
void YaVehicleAPI.ReleaseDriving(YaEntity vehicle)
Releases a driver from a vehicle
vehicleThe target vehicle entity that the driver controls
void YaVehicleAPI.OnSetDriver(YaEntity vehicleEntity, function callbackYaEntity)
Fired when a driver is assigned to the vehicle entity
vehicleEntityThe vehicle entitycallbackThe callback function to be called when the driver is assignedentityThe driver entity that controls the vehicle
void YaVehicleAPI.OnReleaseDriver(YaEntity vehicleEntity, function callbackYaEntity)
Fired when a driver is released from a vehicle entity
vehicleEntityThe vehicle entitycallbackThe callback function to be called when the driver is releasedentityThe driver entity
boolean YaVehicleAPI.IsVehicleInAir(YaEntity vehicleEntity)
vehicleEntityThe vehicle entity