Skip to content

five-on-it / packages/protocol/src/messages / VehicleInput

Interface: VehicleInput ​

Defined in: packages/protocol/src/messages.ts:17

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:32

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:38

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:48

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:36

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:42

Take cover at the wall ahead, or leave it (one-shot, server-validated).


drop ​

drop: boolean

Defined in: packages/protocol/src/messages.ts:59

Drop the selected item at the character's feet (one-shot, server-validated).


expose ​

expose: boolean

Defined in: packages/protocol/src/messages.ts:44

Out of cover: popped up, able to shoot and be shot.


fire ​

fire: boolean

Defined in: packages/protocol/src/messages.ts:40

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:23

Handbrake held; on foot, jump.


interact ​

interact: boolean

Defined in: packages/protocol/src/messages.ts:69

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:27

Switch the car to the next vehicle class (server-validated, rate-limited).


phone ​

phone: number

Defined in: packages/protocol/src/messages.ts:80

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:25

Reset the car to a spawn point (server-validated, rate-limited).


resetLevel ​

resetLevel: boolean

Defined in: packages/protocol/src/messages.ts:50

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:34

On foot: run instead of walk.


service ​

service: number

Defined in: packages/protocol/src/messages.ts:74

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:52

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:57

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:21

-1 (right) to 1 (left; positive yaw); on foot, movement along +x.


target ​

target: number

Defined in: packages/protocol/src/messages.ts:46

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:19

-1 (full reverse/brake) to 1 (full throttle); on foot, movement along +z.


transfer ​

transfer: number

Defined in: packages/protocol/src/messages.ts:67

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:61

Use the selected item (one-shot, server-validated): a first-aid kit heals.