Vehicle
Defined in: server/api.d.ts:310
Replicated M2O vehicle handle.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Vehicle(
id):Vehicle
Defined in: server/api.d.ts:315
Creates a script wrapper for an existing vehicle with this ID; use Vehicle.spawn() to spawn a vehicle.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Vehicle
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”attachPart()
Section titled “attachPart()”attachPart(
index):void
Defined in: server/api.d.ts:826
Puts a previously torn-off deform part back on the body on every client.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
Returns
Section titled “Returns”void
breakLight()
Section titled “breakLight()”breakLight(
index):void
Defined in: server/api.d.ts:845
Smashes one headlight on every client.
Parameters
Section titled “Parameters”number
Headlight index from 0 through 31.
Returns
Section titled “Returns”void
clearRadio()
Section titled “clearRadio()”clearRadio():
void
Defined in: server/api.d.ts:898
Turns off this vehicle’s in-car radio.
Returns
Section titled “Returns”void
clearWantedLevel()
Section titled “clearWantedLevel()”clearWantedLevel():
void
Defined in: server/api.d.ts:760
Clears the vehicle wanted icon for its current driver.
Returns
Section titled “Returns”void
destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:476
Destroys this replicated vehicle after emitting vehicleDestroy.
Returns
Section titled “Returns”void
detachPart()
Section titled “detachPart()”detachPart(
index):void
Defined in: server/api.d.ts:820
Tears one deform part off the body on every client. Silent: no debris, sound or impulse.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
Returns
Section titled “Returns”void
explode()
Section titled “explode()”explode():
void
Defined in: server/api.d.ts:749
Blows the vehicle up on every client with the native explosion, killing its occupants, and marks it destroyed until repair(). Emits vehicleExplode with a null attacker.
Returns
Section titled “Returns”void
getBeacon()
Section titled “getBeacon()”getBeacon():
boolean
Defined in: server/api.d.ts:585
Checks the replicated emergency-beacon state.
Returns
Section titled “Returns”boolean
True when the beacon is active.
getColor()
Section titled “getColor()”getColor():
number
Defined in: server/api.d.ts:632
Returns the stored primary paint color.
Returns
Section titled “Returns”number
Packed 0x00RRGGBB, or -1 when the model default is used.
getColorSecondary()
Section titled “getColorSecondary()”getColorSecondary():
number
Defined in: server/api.d.ts:646
Returns the stored secondary paint color.
Returns
Section titled “Returns”number
Packed 0x00RRGGBB, or -1 when the model default is used.
getControl()
Section titled “getControl()”getControl(
control):boolean
Defined in: server/api.d.ts:490
Reads an accessory from the current replicated control flags.
Parameters
Section titled “Parameters”control
Section titled “control”number
Vehicle accessory control identifier.
Returns
Section titled “Returns”boolean
True when the selected accessory is active.
getDirt()
Section titled “getDirt()”getDirt():
number
Defined in: server/api.d.ts:675
Returns the stored dirt level.
Returns
Section titled “Returns”number
A value from 0 through 100.
getEngine()
Section titled “getEngine()”getEngine():
boolean
Defined in: server/api.d.ts:507
Checks the server-held engine state.
Returns
Section titled “Returns”boolean
True when the engine is commanded on.
getEngineHealth()
Section titled “getEngineHealth()”getEngineHealth():
number
Defined in: server/api.d.ts:887
Returns the most recently driver-reported engine health.
Returns
Section titled “Returns”number
Health from 0 through 100, or -1 before the first report.
getEngineLocked()
Section titled “getEngineLocked()”getEngineLocked():
boolean
Defined in: server/api.d.ts:519
Checks whether the engine is locked.
Returns
Section titled “Returns”boolean
True when the engine is locked.
getFuel()
Section titled “getFuel()”getFuel():
number
Defined in: server/api.d.ts:869
Returns the most recently driver-reported fuel amount.
Returns
Section titled “Returns”number
Current fuel, or -1 before the first report.
getFuelCapacity()
Section titled “getFuelCapacity()”getFuelCapacity():
number
Defined in: server/api.d.ts:875
Returns the driver-reported fuel tank max capacity.
Returns
Section titled “Returns”number
Tank capacity, or -1 before the first report.
getHazard()
Section titled “getHazard()”getHazard():
boolean
Defined in: server/api.d.ts:563
Checks the replicated hazard-light state.
Returns
Section titled “Returns”boolean
True when both turn indicators are active.
getHood()
Section titled “getHood()”getHood():
boolean
Defined in: server/api.d.ts:607
Checks the replicated hood state.
Returns
Section titled “Returns”boolean
True when the hood is open.
getHorn()
Section titled “getHorn()”getHorn():
boolean
Defined in: server/api.d.ts:596
Checks the replicated horn state.
Returns
Section titled “Returns”boolean
True while the horn is active.
getLeftIndicator()
Section titled “getLeftIndicator()”getLeftIndicator():
boolean
Defined in: server/api.d.ts:541
Checks the replicated left-indicator state.
Returns
Section titled “Returns”boolean
True when the left indicator is active.
getLightCount()
Section titled “getLightCount()”getLightCount():
number
Defined in: server/api.d.ts:832
Returns how many headlights this vehicle model has.
Returns
Section titled “Returns”number
The light count, or 0 until a client has reported the model’s part table.
getLights()
Section titled “getLights()”getLights():
boolean
Defined in: server/api.d.ts:530
Checks the replicated headlight state.
Returns
Section titled “Returns”boolean
True when either low or high beams are active.
getPart()
Section titled “getPart()”getPart(
index):boolean
Defined in: server/api.d.ts:780
Checks the stored visibility state of one vehicle part.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
Returns
Section titled “Returns”boolean
True when the part is visible.
getPartCount()
Section titled “getPartCount()”getPartCount():
number
Defined in: server/api.d.ts:786
Returns how many deform parts this vehicle model has.
Returns
Section titled “Returns”number
The part count, or 0 until a client has reported the model’s part table.
getPartsOfType()
Section titled “getPartsOfType()”getPartsOfType(
type):number[]
Defined in: server/api.d.ts:800
Lists the deform-part indices of one part type on this vehicle model.
Parameters
Section titled “Parameters”number
A VehiclePartType value, such as VehiclePartType.Wheel.
Returns
Section titled “Returns”number[]
Matching part indices, empty when the model’s part table is unknown.
getPartStage()
Section titled “getPartStage()”getPartStage(
index):number
Defined in: server/api.d.ts:814
Returns the driver-reported damage stage of one deform part.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
Returns
Section titled “Returns”number
The damage stage from 0 for undamaged through 3.
getPartType()
Section titled “getPartType()”getPartType(
index):number
Defined in: server/api.d.ts:793
Returns the VehiclePartType of one deform part.
Parameters
Section titled “Parameters”number
Model-specific deform-part index.
Returns
Section titled “Returns”number
A numeric VehiclePartType value, or -1 when the index or the model is unknown.
getRightIndicator()
Section titled “getRightIndicator()”getRightIndicator():
boolean
Defined in: server/api.d.ts:552
Checks the replicated right-indicator state.
Returns
Section titled “Returns”boolean
True when the right indicator is active.
getSiren()
Section titled “getSiren()”getSiren():
boolean
Defined in: server/api.d.ts:574
Checks the replicated siren state.
Returns
Section titled “Returns”boolean
True when the siren is active.
getTrunk()
Section titled “getTrunk()”getTrunk():
boolean
Defined in: server/api.d.ts:618
Checks the replicated trunk state.
Returns
Section titled “Returns”boolean
True when the trunk is open.
getWheelModel()
Section titled “getWheelModel()”getWheelModel(
index):string
Defined in: server/api.d.ts:713
Returns the stored model name for one wheel group.
Parameters
Section titled “Parameters”number
Wheel group: 0 front, 1 rear, or 2 spare.
Returns
Section titled “Returns”string
The wheel model name, or an empty string when the default is used.
getWheelState()
Section titled “getWheelState()”getWheelState(
index):number
Defined in: server/api.d.ts:727
Returns the damage state of one wheel: the driver’s live report while the vehicle is occupied, otherwise the last value reported or set.
Parameters
Section titled “Parameters”number
Vehicle wheel index.
Returns
Section titled “Returns”number
A numeric VehicleWheelState value.
getWipers()
Section titled “getWipers()”getWipers():
boolean
Defined in: server/api.d.ts:693
Checks the stored windshield-wiper state.
Returns
Section titled “Returns”boolean
True when the wipers are active.
isLightBroken()
Section titled “isLightBroken()”isLightBroken(
index):boolean
Defined in: server/api.d.ts:839
Checks whether one headlight is smashed.
Parameters
Section titled “Parameters”number
Headlight index from 0 through 31.
Returns
Section titled “Returns”boolean
True when the headlight is broken.
isPartDropped()
Section titled “isPartDropped()”isPartDropped(
index):boolean
Defined in: server/api.d.ts:807
Checks whether one deform part has been torn off the body.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
Returns
Section titled “Returns”boolean
True when the part is missing.
repair()
Section titled “repair()”repair():
void
Defined in: server/api.d.ts:744
Fully repairs native deformation, mechanical and part damage, wheels, paint, and tuning, then stops the vehicle without moving it. Also restores a destroyed (exploded) vehicle.
Returns
Section titled “Returns”void
repairLight()
Section titled “repairLight()”repairLight(
index):void
Defined in: server/api.d.ts:851
Restores one smashed headlight. It re-breaks while body deformation still displaces the lamp.
Parameters
Section titled “Parameters”number
Headlight index from 0 through 31.
Returns
Section titled “Returns”void
resetColor()
Section titled “resetColor()”resetColor():
void
Defined in: server/api.d.ts:651
Restores the model’s factory primary paint and broadcasts it to all clients.
Returns
Section titled “Returns”void
resetColorSecondary()
Section titled “resetColorSecondary()”resetColorSecondary():
void
Defined in: server/api.d.ts:656
Restores the model’s factory secondary paint and broadcasts it to all clients.
Returns
Section titled “Returns”void
setColor()
Section titled “setColor()”setColor(
r,g,b):void
Defined in: server/api.d.ts:626
Sets the server-authoritative primary paint color and broadcasts it to all clients.
Parameters
Section titled “Parameters”number
Primary red component from 0 through 255.
number
Primary green component from 0 through 255.
number
Primary blue component from 0 through 255.
Returns
Section titled “Returns”void
setColorSecondary()
Section titled “setColorSecondary()”setColorSecondary(
r,g,b):void
Defined in: server/api.d.ts:640
Sets the server-authoritative secondary paint color and broadcasts it to all clients.
Parameters
Section titled “Parameters”number
Secondary red component from 0 through 255.
number
Secondary green component from 0 through 255.
number
Secondary blue component from 0 through 255.
Returns
Section titled “Returns”void
setControl()
Section titled “setControl()”setControl(
control,action):void
Defined in: server/api.d.ts:483
Changes an accessory control. A driver applies the command natively; otherwise the server updates replicated state directly. The engine control behaves like setEngine.
Parameters
Section titled “Parameters”control
Section titled “control”number
Vehicle accessory control identifier.
action
Section titled “action”0 | 1 | 2
Action: 0 turns the control off, 1 turns it on, and 2 toggles it.
Returns
Section titled “Returns”void
setDirt()
Section titled “setDirt()”setDirt(
level):void
Defined in: server/api.d.ts:669
Sets and replicates the vehicle’s dirt level.
Parameters
Section titled “Parameters”number
Dirt amount from 0 for clean to 100 for fully dirty.
Returns
Section titled “Returns”void
setEngine()
Section titled “setEngine()”setEngine(
enabled):void
Defined in: server/api.d.ts:501
Sets the server-held engine state and applies it on the driver’s client, which has no way to start the engine itself. Starting is ignored while the engine is locked.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
True to start the engine; false to stop it.
Returns
Section titled “Returns”void
setEngineHealth()
Section titled “setEngineHealth()”setEngineHealth(
health):void
Defined in: server/api.d.ts:881
Broadcasts a one-shot native engine-health update to every live copy of this vehicle.
Parameters
Section titled “Parameters”health
Section titled “health”number
Engine health from 0 for destroyed to 100 for perfect.
Returns
Section titled “Returns”void
setEngineLocked()
Section titled “setEngineLocked()”setEngineLocked(
locked):void
Defined in: server/api.d.ts:513
Locks or unlocks the engine, for car keys and immobilisers. Locking stops the engine and keeps it off; setEngine(true) and toggleEngine are ignored until it is unlocked. Unlocking does not start the engine.
Parameters
Section titled “Parameters”locked
Section titled “locked”boolean
True to immobilise the vehicle; false to release it.
Returns
Section titled “Returns”void
setFuel()
Section titled “setFuel()”setFuel(
fuel):void
Defined in: server/api.d.ts:863
Broadcasts a one-shot fuel update to every live copy of this vehicle.
Parameters
Section titled “Parameters”number
Target native fuel amount; each client clamps it to the vehicle tank.
Returns
Section titled “Returns”void
setLocked()
Section titled “setLocked()”setLocked(
locked):void
Defined in: server/api.d.ts:857
Convenience method that sets the entry lock to fully locked or unlocked.
Parameters
Section titled “Parameters”locked
Section titled “locked”boolean
True for fully locked; false for unlocked.
Returns
Section titled “Returns”void
setLockState()
Section titled “setLockState()”setLockState(
state):void
Defined in: server/api.d.ts:766
Sets the server-authoritative vehicle entry lock state.
Parameters
Section titled “Parameters”number
Entry lock state: 0 unlocked, 1 breakable, or 2 fully locked.
Returns
Section titled “Returns”void
setModel()
Section titled “setModel()”setModel(
modelId):boolean
Defined in: server/api.d.ts:663
Swaps the vehicle’s model while keeping its id, position, cosmetics and fuel. Every client rebuilds the car in place: damage resets and occupants are re-seated where the new model has their seat.
Parameters
Section titled “Parameters”modelId
Section titled “modelId”number
Mafia II vehicle model identifier.
Returns
Section titled “Returns”boolean
True when the model was applied; false for an unknown model or a destroyed vehicle.
setPart()
Section titled “setPart()”setPart(
index,enabled):void
Defined in: server/api.d.ts:773
Shows or hides one model-specific vehicle part on all clients.
Parameters
Section titled “Parameters”number
Model-specific deform-part index from 0 through 63.
enabled
Section titled “enabled”boolean
Whether the selected part is visible.
Returns
Section titled “Returns”void
setPlate()
Section titled “setPlate()”setPlate(
text):void
Defined in: server/api.d.ts:699
Sets and replicates the vehicle’s license-plate text.
Parameters
Section titled “Parameters”string
License-plate text, limited to six characters by the game.
Returns
Section titled “Returns”void
setRadioLocked()
Section titled “setRadioLocked()”setRadioLocked(
locked):void
Defined in: server/api.d.ts:904
Locks or unlocks driver-controlled radio station changes.
Parameters
Section titled “Parameters”locked
Section titled “locked”boolean
Whether the driver is prevented from changing station.
Returns
Section titled “Returns”void
setRadioStation()
Section titled “setRadioStation()”setRadioStation(
station):void
Defined in: server/api.d.ts:893
Sets the in-car radio station for this vehicle’s driver.
Parameters
Section titled “Parameters”station
Section titled “station”number
Native radio station identifier; a negative value turns the radio off.
Returns
Section titled “Returns”void
setSpeedLimiter()
Section titled “setSpeedLimiter()”setSpeedLimiter(
enabled):void
Defined in: server/api.d.ts:733
Enables or disables the vehicle speed limiter on all clients.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Whether the native server-controlled speed limiter is active.
Returns
Section titled “Returns”void
setSpeedLimiterSpeed()
Section titled “setSpeedLimiterSpeed()”setSpeedLimiterSpeed(
kmh):void
Defined in: server/api.d.ts:739
Sets and replicates the vehicle speed-limiter threshold.
Parameters
Section titled “Parameters”number
Maximum speed in kilometres per hour; a negative value restores the model default.
Returns
Section titled “Returns”void
setTuning()
Section titled “setTuning()”setTuning(
level):void
Defined in: server/api.d.ts:681
Sets and replicates the vehicle’s visual tuning level.
Parameters
Section titled “Parameters”number
Tuning level from 0 for stock through 3.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:4154
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:4160
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setWantedLevel()
Section titled “setWantedLevel()”setWantedLevel(
level):void
Defined in: server/api.d.ts:755
Sets the vehicle wanted icon shown to its current driver.
Parameters
Section titled “Parameters”number
Non-zero native vehicle wanted-icon level; zero hides the icon.
Returns
Section titled “Returns”void
setWheelModel()
Section titled “setWheelModel()”setWheelModel(
index,name):void
Defined in: server/api.d.ts:706
Sets and replicates the model used by one wheel group.
Parameters
Section titled “Parameters”number
Wheel group: 0 front, 1 rear, or 2 spare.
string
Wheel model name; an empty string restores the vehicle model default.
Returns
Section titled “Returns”void
setWheelState()
Section titled “setWheelState()”setWheelState(
index,state):void
Defined in: server/api.d.ts:720
Sets and replicates the damage state of one wheel.
Parameters
Section titled “Parameters”number
Vehicle wheel index.
number
Damage state from VehicleWheelState: Normal, Deflated, or BlownOut.
Returns
Section titled “Returns”void
setWipers()
Section titled “setWipers()”setWipers(
enabled):void
Defined in: server/api.d.ts:687
Sets and replicates the vehicle’s windshield wipers.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Whether the windshield wipers are active.
Returns
Section titled “Returns”void
toggleBeacon()
Section titled “toggleBeacon()”toggleBeacon():
void
Defined in: server/api.d.ts:579
Toggles the vehicle emergency beacon.
Returns
Section titled “Returns”void
toggleEngine()
Section titled “toggleEngine()”toggleEngine():
void
Defined in: server/api.d.ts:495
Toggles the server-held engine state. Ignored while the engine is locked.
Returns
Section titled “Returns”void
toggleHazard()
Section titled “toggleHazard()”toggleHazard():
void
Defined in: server/api.d.ts:557
Toggles both turn indicators as hazard lights.
Returns
Section titled “Returns”void
toggleHood()
Section titled “toggleHood()”toggleHood():
void
Defined in: server/api.d.ts:601
Toggles the vehicle hood between open and closed.
Returns
Section titled “Returns”void
toggleHorn()
Section titled “toggleHorn()”toggleHorn():
void
Defined in: server/api.d.ts:590
Toggles the vehicle horn.
Returns
Section titled “Returns”void
toggleLeftIndicator()
Section titled “toggleLeftIndicator()”toggleLeftIndicator():
void
Defined in: server/api.d.ts:535
Toggles the left turn indicator.
Returns
Section titled “Returns”void
toggleLights()
Section titled “toggleLights()”toggleLights():
void
Defined in: server/api.d.ts:524
Toggles the vehicle headlights.
Returns
Section titled “Returns”void
toggleRightIndicator()
Section titled “toggleRightIndicator()”toggleRightIndicator():
void
Defined in: server/api.d.ts:546
Toggles the right turn indicator.
Returns
Section titled “Returns”void
toggleSiren()
Section titled “toggleSiren()”toggleSiren():
void
Defined in: server/api.d.ts:568
Toggles the vehicle siren.
Returns
Section titled “Returns”void
toggleTrunk()
Section titled “toggleTrunk()”toggleTrunk():
void
Defined in: server/api.d.ts:612
Toggles the vehicle trunk between open and closed.
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:471
Returns a readable representation of this vehicle.
Returns
Section titled “Returns”string
The vehicle ID and model formatted for logging or debugging.
Inherited from
Section titled “Inherited from”spawn()
Section titled “spawn()”
staticspawn(model,position?,rotation?):Vehicle
Defined in: server/api.d.ts:913
Spawns and replicates a new vehicle.
Parameters
Section titled “Parameters”string | number
A vehicle model id, or a model name: a stock car, or the file name of a car .sds a resource ships in stream/sds/cars/.
position?
Section titled “position?”Partial<Vector3>
Optional initial world-space position; omitted components default to zero.
rotation?
Section titled “rotation?”Optional initial orientation: a Quaternion, or a Vector3 of Euler angles in degrees.
Returns
Section titled “Returns”Vehicle
The newly spawned vehicle handle.
Properties
Section titled “Properties”beacon
Section titled “beacon”
readonlybeacon:boolean
Defined in: server/api.d.ts:450
Whether the replicated emergency beacon is on.
brokenLights
Section titled “brokenLights”
readonlybrokenLights:number[]
Defined in: server/api.d.ts:375
Headlight indices that are currently smashed.
readonlycolor:number
Defined in: server/api.d.ts:330
Packed primary paint color 0x00RRGGBB, or -1 for the model default.
colorSecondary
Section titled “colorSecondary”
readonlycolorSecondary:number
Defined in: server/api.d.ts:335
Packed secondary paint color 0x00RRGGBB, or -1 for the model default.
destroyed
Section titled “destroyed”
readonlydestroyed:boolean
Defined in: server/api.d.ts:410
Whether the vehicle has been blown up and not repaired since.
readonlydirt:number
Defined in: server/api.d.ts:345
Stored dirt level from 0 through 100.
droppedParts
Section titled “droppedParts”
readonlydroppedParts:number[]
Defined in: server/api.d.ts:370
Deform-part indices that have been torn off this vehicle.
engine
Section titled “engine”
readonlyengine:boolean
Defined in: server/api.d.ts:415
Whether the server-held engine state is on.
engineHealth
Section titled “engineHealth”
readonlyengineHealth:number
Defined in: server/api.d.ts:405
Most recently driver-reported engine health from 0 through 100, or -1 before the first report.
engineLocked
Section titled “engineLocked”
readonlyengineLocked:boolean
Defined in: server/api.d.ts:420
Whether the engine is locked (immobilised).
readonlyfuel:number
Defined in: server/api.d.ts:395
Most recently driver-reported fuel amount, or -1 before the first report.
fuelCapacity
Section titled “fuelCapacity”
readonlyfuelCapacity:number
Defined in: server/api.d.ts:400
Driver-reported fuel tank max capacity, or -1 before the first report.
hasCustomColor
Section titled “hasCustomColor”
readonlyhasCustomColor:boolean
Defined in: server/api.d.ts:340
Whether a script paint overrides the primary or secondary factory color.
hazard
Section titled “hazard”
readonlyhazard:boolean
Defined in: server/api.d.ts:440
Whether both replicated turn indicators are on as hazard lights.
readonlyhood:boolean
Defined in: server/api.d.ts:460
Whether the replicated hood is open.
readonlyhorn:boolean
Defined in: server/api.d.ts:455
Whether the replicated horn is active.
readonlyid:number
Defined in: server/api.d.ts:4122
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”leftIndicator
Section titled “leftIndicator”
readonlyleftIndicator:boolean
Defined in: server/api.d.ts:430
Whether the replicated left turn indicator is on.
lights
Section titled “lights”
readonlylights:boolean
Defined in: server/api.d.ts:425
Whether either replicated headlight beam is on.
lockState
Section titled “lockState”
readonlylockState:number
Defined in: server/api.d.ts:325
Entry lock state: 0 unlocked, 1 breakable, or 2 fully locked.
readonlymodel:number
Defined in: server/api.d.ts:320
Mafia II vehicle model identifier; changed with setModel.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:4132
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”radioStation
Section titled “radioStation”
readonlyradioStation:number
Defined in: server/api.d.ts:390
Stored native radio station ID; 255 represents unset or off.
rightIndicator
Section titled “rightIndicator”
readonlyrightIndicator:boolean
Defined in: server/api.d.ts:435
Whether the replicated right turn indicator is on.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:4137
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlysiren:boolean
Defined in: server/api.d.ts:445
Whether the replicated siren is on.
speedLimiter
Section titled “speedLimiter”
readonlyspeedLimiter:boolean
Defined in: server/api.d.ts:380
Whether the server-controlled native speed limiter is enabled.
speedLimiterSpeed
Section titled “speedLimiterSpeed”
readonlyspeedLimiterSpeed:number
Defined in: server/api.d.ts:385
Speed-limiter threshold in kilometres per hour, or a negative model-default value.
readonlystate:StateBag
Defined in: server/api.d.ts:4142
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”
readonlytrunk:boolean
Defined in: server/api.d.ts:465
Whether the replicated trunk is open.
tuning
Section titled “tuning”
readonlytuning:number
Defined in: server/api.d.ts:350
Stored tuning level from 0 for stock through 3.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:4127
Current virtual-world identifier.
Inherited from
Section titled “Inherited from”wheelModels
Section titled “wheelModels”
readonlywheelModels:string[]
Defined in: server/api.d.ts:360
Stored model names for the front, rear, and spare wheel groups.
wheelStates
Section titled “wheelStates”
readonlywheelStates:number[]
Defined in: server/api.d.ts:365
VehicleWheelState value for every wheel, reported live by the driver while the vehicle is occupied.
wipers
Section titled “wipers”
readonlywipers:boolean
Defined in: server/api.d.ts:355
Whether the windshield wipers are active.
