five-on-it / packages/protocol/src/messages / VehicleInput
Interface: VehicleInput
Defined in: packages/protocol/src/messages.ts:18
What a player asks on one tick. In a car the axes are throttle and steering; on foot they move the character (throttle along +z, steer along +x) and the handbrake key jumps.
Properties
action
action:
boolean
Defined in: packages/protocol/src/messages.ts:33
The interaction key: on foot, get into the nearest car (at the wheel or as a passenger) or carjack its driver; seated, get out (server-validated, see the simulation's carjack.ts).
aim
aim:
number
Defined in: packages/protocol/src/messages.ts:39
Where the character faces and shoots: a yaw in radians (0 faces +z), from the mouse.
aimDistance
aimDistance:
number
Defined in: packages/protocol/src/messages.ts:49
How far the cursor is from the character (m, quarter metres up to 63.75): where a grenade is thrown to.
boost
boost:
boolean
Defined in: packages/protocol/src/messages.ts:37
In a car: boost, the throttle double-tapped and held; extra engine while the meter lasts.
cover
cover:
boolean
Defined in: packages/protocol/src/messages.ts:43
Take cover at the wall ahead, or leave it (one-shot, server-validated).
drop
drop:
boolean
Defined in: packages/protocol/src/messages.ts:60
Drop the selected item at the character's feet (one-shot, server-validated).
expose
expose:
boolean
Defined in: packages/protocol/src/messages.ts:45
Out of cover: popped up, able to shoot and be shot.
fire
fire:
boolean
Defined in: packages/protocol/src/messages.ts:41
The trigger is held: the weapon of the selected slot fires (server-validated, rate-limited per weapon, while its ammunition lasts).
handbrake
handbrake:
boolean
Defined in: packages/protocol/src/messages.ts:24
Handbrake held; on foot, jump.
interact
interact:
boolean
Defined in: packages/protocol/src/messages.ts:70
The interaction key is held (on foot at a locked car it picks the lock; server-validated).
nextClass
nextClass:
boolean
Defined in: packages/protocol/src/messages.ts:28
Switch the car to the next vehicle class (server-validated, rate-limited).
phone
phone:
number
Defined in: packages/protocol/src/messages.ts:81
What the player's phone is doing, for the others to see (nothing the server acts on): 0 put away, 1 out in the hand, 2 held to the ear on a call, 3 in a conversation face to face or at a terminal's or a keypad's screen.
reset
reset:
boolean
Defined in: packages/protocol/src/messages.ts:26
Reset the car to a spawn point (server-validated, rate-limited).
resetLevel
resetLevel:
boolean
Defined in: packages/protocol/src/messages.ts:51
Reset the whole level: everyone back in a fresh car at their spawn, new pedestrians (one-shot, server-validated).
run
run:
boolean
Defined in: packages/protocol/src/messages.ts:35
On foot: run instead of walk.
service
service:
number
Defined in: packages/protocol/src/messages.ts:75
At the wheel of a car standing still in a garage (one-shot, server-validated): 1 a respray, 2 storing the car; 0 none.
siren
siren:
boolean
Defined in: packages/protocol/src/messages.ts:53
At the wheel of a class with a siren: run it (held; the horn key switches it on and off).
slot
slot:
number
Defined in: packages/protocol/src/messages.ts:58
The selected slot of the character's inventory (0 to 15): the weapon held (an item that is no weapon, or an empty slot, the fists), what use and drop act on.
steer
steer:
number
Defined in: packages/protocol/src/messages.ts:22
-1 (right) to 1 (left; positive yaw); on foot, movement along +x.
target
target:
number
Defined in: packages/protocol/src/messages.ts:47
Which of the targets on the line of fire to shoot, nearest first (the scroll wheel; wraps).
throttle
throttle:
number
Defined in: packages/protocol/src/messages.ts:20
-1 (full reverse/brake) to 1 (full throttle); on foot, movement along +z.
transfer
transfer:
number
Defined in: packages/protocol/src/messages.ts:68
Move a stack between the character and the container it has open (one-shot, server-validated): n > 0 takes the container's slot n − 1, n < 0 puts the character's slot −n − 1 in, 0 none.
use
use:
boolean
Defined in: packages/protocol/src/messages.ts:62
Use the selected item (one-shot, server-validated): a first-aid kit heals.