- Documentation
- Shared functions
- getVehicleFactoryEngine
Function
getVehicleFactoryEngine
Returns a model's factory engine. Power is calculated from the game's handling, and the other data (torque, displacement, cylinders, mass) are a realistic estimate, marked with estimated = true. It gives a reference point for tuning systems.
Syntax
table getVehicleFactoryEngine(int model)Arguments
modelint- Vehicle model ID.
Returns
A table: power, torque, displacement, cylinders, fuel, mass, gears, estimated, factory; false for an unknown model.
Example
local engine = getVehicleFactoryEngine(411)
outputDebugString(("Infernus: %s kW, %s l, %d cyl."):format(engine.power, engine.displacement, engine.cylinders))
See also
getVehicleEngineReturns the vehicle's engine: the one fitted withsetVehicleEngineor, when none was fitted, the factory engine calculated from game data (withfactory = true). The second value is wear 0..1. Works on both sides.setVehicleEngineFits a vehicle with an engine described by real-car parameters (power, torque, displacement, fuel, mass, gears) and calculates the handling fields from them: mass, top speed, acceleration, engine inertia, fuel type, number of gears and grip. An engine much stronger than the factory one reduces grip (wheelspin). Wear lowers power by up to 30%.nilrestores the factory engine. Good for tuning and engine-swap systems on RP servers.