How to add NO2 to a car

Started by NicusorN5, Apr 22, 2016, 04:03 PM

Previous topic - Next topic

NicusorN5

Can you complete my script?I have no idea on changing car acceleration.
BTW i did bind the X key.
function onKeyDown( player, key )
{
if(key == x )
{
//Increase+1.0 m/s to car acceleration
}
function onKeyDown( player, key )
{
if(key == x )
{
//Decrease +1.0 m/s to car acceleration
}

maxorator

local vehicle = player.Vehicle;

if (vehicle != null) {
    vehicle.SetHandlingData(14, vehicle.GetHandlingData(14) + 100.0);
}

local vehicle = player.Vehicle;

if (vehicle != null) {
    vehicle.ResetHandlingData(14);
}

ysc3839

#2
Quote from: maxorator on Apr 22, 2016, 05:35 PMlocal vehicle = player.Vehicle;

if (vehicle != null) {
    vehicle.SetHandlingData(14, vehicle.GetHandlingData(14) + 100.0);
}

local vehicle = player.Vehicle;

if (vehicle != null) {
    vehicle.ResetHandlingData(14);
}
Do you have a list of vehcle's handling data?
I found them on there https://vcmpdev.wordpress.com/2012/02/18/changing-vehicle-handling/
1 Mass
 2 DimensionsX
 3 DimensionsY
 4 DimensionsZ
 5 CentreOfMassX
 6 CentreOfMassY
 7 CentreOfMassZ
 8 PercentSubmerged
 9 TractionMultiplier
10 TractionLoss
11 TractionBias
12 NumberOfGears
13 MaxSpeed
14 Acceleration
15 DriveType
16 EngineType
17 BrakeDeceleration
18 BrakeBias
19 SteeringLock
20 SuspensionForceLevel
21 SuspensionDampening
22 SeatOffset
23 DamageMultiplier
24 SuspensionUpperLimit
25 SuspensionLowerLimit
26 SuspensionBias
27 SuspensionAntiDive
28 Flags
29 LightsFront
30 LightsRear
31 SuperiorGrip
32 FlyingMode
33 DriveOnWater