setCruiseControl: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
m (Add details)
Line 7: Line 7:
|eff= local
|eff= local


|descr= Limits or set a vehicle's speed through cruise control. {{Feature|important|This command only works for the local player.}}
|descr= Limits or set a player-controlled vehicle's speed through cruise control. {{Feature|important|This command only works:
* for the local player
* on CarX, TankX and ShipX simulated vehicles
}}


|gr1= Unit Control
|gr1= Unit Control
Line 20: Line 23:


|p3= autoThrust: [[Boolean]]
|p3= autoThrust: [[Boolean]]
* [[true]] - cruise control. The vehicle will maintain this speed until brakes is applied or driver dies
* [[true]] - cruise control. The vehicle will maintain this speed until brakes is applied or driver dies or leaves the vehicle
* [[false]] - speed limiter - The vehicle will not go faster than the set speed
* [[false]] - speed limiter - The vehicle will not accelerate above set speed


|r1= [[Nothing]]
|r1= [[Nothing]]
Line 33: Line 36:
|x4= <code>[[vehicle]] [[player]] [[setCruiseControl]] [-5, [[false]]]; {{cc|will make the vehicle go backwards too (speed cannot be over -5 km/h)}}</code>
|x4= <code>[[vehicle]] [[player]] [[setCruiseControl]] [-5, [[false]]]; {{cc|will make the vehicle go backwards too (speed cannot be over -5 km/h)}}</code>


|seealso= [[getCruiseControl]] [[limitSpeed]] [[forceSpeed]]
|seealso= [[getCruiseControl]] [[limitSpeed]] [[forceSpeed]] [[setAirplaneThrottle]]
}}
}}

Revision as of 14:04, 19 May 2021

Hover & click on the images for description

Description

Description:
Limits or set a player-controlled vehicle's speed through cruise control.
This command only works:
  • for the local player
  • on CarX, TankX and ShipX simulated vehicles
Groups:
Unit ControlObject Manipulation

Syntax

Syntax:
vehicle setCruiseControl [speed, autoThrust]
Parameters:
vehicle: Object - the vehicle to limit
speed: Number - desired/top speed in km/h. 0 to disable any setting. Negative values for reverse gear speed
autoThrust: Boolean
  • true - cruise control. The vehicle will maintain this speed until brakes is applied or driver dies or leaves the vehicle
  • false - speed limiter - The vehicle will not accelerate above set speed
Return Value:
Nothing

Examples

Example 1:
vehicle player setCruiseControl [50, true]; // sets cruise control to 50 km/h
Example 2:
vehicle player setCruiseControl [5, false]; // limits player's vehicle speed to 5 km/h
Example 3:
vehicle player setCruiseControl [-5, true]; // will make the vehicle go backwards
Example 4:
vehicle player setCruiseControl [-5, false]; // will make the vehicle go backwards too (speed cannot be over -5 km/h)

Additional Information

See also:
getCruiseControl limitSpeed forceSpeed setAirplaneThrottle

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note