Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Introduced in

Version:1.31

Description

Description:Returns the gear a vehicle is currently in.

For vehicles that do not have selectable gears implemented (no

'

complexGearbox

'

class defined), the returned gear is calculated, based on the RPM, and

will return

returns: 0: reverse, 1: neutral, 2: first forward gear,

etc

and so on.

For vehicles that

do

have selectable gears, negative values are reverse, 0 are neutral, and positive are forward gears

, e.g.

. For example, -2: 2nd Reverse, -1: 1st Reverse, 0: neutral, 1: 1st Forward, 2: 2nd Forward,

etc. (The

and so on (the range depends on what is defined for the specific vehicle).

)

Syntax

Syntax:getGear vehicle
Parameters:
  • vehicle: Object - Vehicle to check.
Return Value:Number - Current gear.

Alternative Syntax

Syntax:getGear [vehicle, mode] (V1.68+
&
and V2.08+)
Parameters:
info
  • information to return. Can be:
    • "SHIFT": Returns
gear that was selected manually
    • a manually selected gear.
    • "GEAR": Returns the gear
actually
    • used by the gearbox. It should differ from shifted gear for semi-
auto
    • automatic gearboxes
(i.e. you have shifted
    • . For example, if you shift into 5th gear
, but running only on
    • from 2nd gear,
because you are moving slow, then
    • this mode
will return
    • returns 2
)
    • .
    • "TRANS": Returns the transmission gear
.
    • - 0 means 1st transmission gear, 1 means 2nd transmission gear
etc
    • , and so on. If the vehicle is not using a transmission gearbox, it
will
    • always
return
    • returns 0,
like
    • as if it
has
    • had just one gear ratio (1:1)
defined for it
    • .
Return Value:Number - Gear information as specified in
"
mode
"
.

Examples

Examples:
_gear = getGear car1
_selected = getGear [car1,"SHIFT"]

Additional Information

See also: setGear, getRpm
Multiplayer: 
Problems: 

Notes