Class Vehicle
A vehicle element
Vehicle elements represent ingame vehicles such as cars, bikes, airplanes, etc.
Vechicles are synchronised by clients, usually by the driver, but when unoccupied by a player in close vincinity.
Assembly: SlipeServer.Server.dll
Syntax
public class Vehicle : Element
Constructors
|
Edit this page
View Source
Vehicle(VehicleModel, Vector3)
Declaration
public Vehicle(VehicleModel model, Vector3 position)
Parameters
|
Edit this page
View Source
Vehicle(ushort, Vector3)
Declaration
public Vehicle(ushort model, Vector3 position)
Parameters
Fields
|
Edit this page
View Source
CanEnter
Declaration
public Func<Ped, Vehicle, byte, bool>? CanEnter
Field Value
|
Edit this page
View Source
CanExit
Declaration
public Func<Ped, Vehicle, byte, bool>? CanExit
Field Value
|
Edit this page
View Source
model
Declaration
Field Value
|
Edit this page
View Source
paintJob
Declaration
Field Value
Properties
|
Edit this page
View Source
AdjustableProperty
Declaration
public ushort? AdjustableProperty { get; set; }
Property Value
|
Edit this page
View Source
AppliedHandling
Declaration
public VehicleHandling AppliedHandling { get; }
Property Value
|
Edit this page
View Source
AreDoorsDamageProof
Declaration
public bool AreDoorsDamageProof { get; set; }
Property Value
|
Edit this page
View Source
BlownState
Declaration
public VehicleBlownState BlownState { get; set; }
Property Value
|
Edit this page
View Source
Colors
Declaration
public Colors Colors { get; }
Property Value
|
Edit this page
View Source
Damage
Declaration
public VehicleDamage Damage { get; init; }
Property Value
|
Edit this page
View Source
DefaultHandling
Declaration
public VehicleHandling DefaultHandling { get; }
Property Value
|
Edit this page
View Source
DoorRatios
Declaration
public float[] DoorRatios { get; set; }
Property Value
|
Edit this page
View Source
Driver
Declaration
public Ped? Driver { get; set; }
Property Value
|
Edit this page
View Source
ElementType
The element type as per MTA's specifications. Multiple C# types can share the same MTA element type.
Declaration
public override ElementType ElementType { get; }
Property Value
Overrides
|
Edit this page
View Source
Handling
Declaration
public VehicleHandling? Handling { get; set; }
Property Value
|
Edit this page
View Source
HeadlightColor
Declaration
public Color HeadlightColor { get; set; }
Property Value
|
Edit this page
View Source
Health
Declaration
public float Health { get; set; }
Property Value
|
Edit this page
View Source
IsDamageProof
Declaration
public bool IsDamageProof { get; set; }
Property Value
|
Edit this page
View Source
IsDerailable
Declaration
public bool IsDerailable { get; set; }
Property Value
|
Edit this page
View Source
IsDerailed
Declaration
public bool IsDerailed { get; set; }
Property Value
|
Edit this page
View Source
IsEngineOn
Declaration
public bool IsEngineOn { get; set; }
Property Value
|
Edit this page
View Source
IsFuelTankExplodable
Declaration
public bool IsFuelTankExplodable { get; set; }
Property Value
|
Edit this page
View Source
IsInWater
Declaration
public bool IsInWater { get; set; }
Property Value
|
Edit this page
View Source
IsLandingGearDown
Declaration
public bool IsLandingGearDown { get; set; }
Property Value
|
Edit this page
View Source
IsLocked
Declaration
public bool IsLocked { get; set; }
Property Value
|
Edit this page
View Source
IsSirenActive
Declaration
public bool IsSirenActive { get; set; }
Property Value
|
Edit this page
View Source
IsTaxiLightOn
Declaration
public bool IsTaxiLightOn { get; set; }
Property Value
|
Edit this page
View Source
IsTrailer
Declaration
public bool IsTrailer { get; }
Property Value
|
Edit this page
View Source
JackingPed
Declaration
public Ped? JackingPed { get; set; }
Property Value
|
Edit this page
View Source
Model
Declaration
public ushort Model { get; set; }
Property Value
|
Edit this page
View Source
Occupants
Declaration
public IReadOnlyDictionary<byte, Ped> Occupants { get; }
Property Value
|
Edit this page
View Source
OverrideLights
Declaration
public VehicleOverrideLights OverrideLights { get; set; }
Property Value
|
Edit this page
View Source
PaintJob
Declaration
public byte PaintJob { get; set; }
Property Value
|
Edit this page
View Source
PlateText
Declaration
public string PlateText { get; set; }
Property Value
|
Edit this page
View Source
RespawnHealth
Declaration
public float RespawnHealth { get; set; }
Property Value
|
Edit this page
View Source
RespawnPosition
Declaration
public Vector3 RespawnPosition { get; set; }
Property Value
|
Edit this page
View Source
RespawnRotation
Declaration
public Vector3 RespawnRotation { get; set; }
Property Value
|
Edit this page
View Source
Sirens
Declaration
public VehicleSirenSet? Sirens { get; set; }
Property Value
|
Edit this page
View Source
Syncer
Declaration
public Player? Syncer { get; set; }
Property Value
|
Edit this page
View Source
TowedVehicle
Vehicle that is being towed by this vehicle
Declaration
public Vehicle? TowedVehicle { get; }
Property Value
|
Edit this page
View Source
TowingChainHead
Vehicle at the very front of a chain of towing vehicles
Declaration
public Vehicle? TowingChainHead { get; }
Property Value
|
Edit this page
View Source
TowingVehicle
Vehicle that is towing this vehicle
Declaration
public Vehicle? TowingVehicle { get; }
Property Value
|
Edit this page
View Source
TrainDirection
Declaration
public TrainDirection TrainDirection { get; set; }
Property Value
|
Edit this page
View Source
TurretRotation
Declaration
public Vector2? TurretRotation { get; set; }
Property Value
|
Edit this page
View Source
Upgrades
Declaration
public VehicleUpgrades Upgrades { get; }
Property Value
|
Edit this page
View Source
Variants
Declaration
public VehicleVariants Variants { get; set; }
Property Value
|
Edit this page
View Source
VehicleType
Declaration
public VehicleType VehicleType { get; }
Property Value
Methods
|
Edit this page
View Source
AddPassenger(byte, Ped, bool)
Declaration
public void AddPassenger(byte seat, Ped ped, bool warpsIn = true)
Parameters
|
Edit this page
View Source
AssociateWith(MtaServer)
Declaration
public Vehicle AssociateWith(MtaServer server)
Parameters
Returns
|
Edit this page
View Source
AttachToTower(Vehicle?, bool)
Declaration
public void AttachToTower(Vehicle? tower, bool updateCounterpart = true)
Parameters
Type |
Name |
Description |
Vehicle |
tower |
|
bool |
updateCounterpart |
|
|
Edit this page
View Source
AttachTrailer(Vehicle?, bool)
Declaration
public void AttachTrailer(Vehicle? trailer, bool updateCounterpart = true)
Parameters
Type |
Name |
Description |
Vehicle |
trailer |
|
bool |
updateCounterpart |
|
|
Edit this page
View Source
BlowUp(bool)
Declaration
public void BlowUp(bool createExplosion = true)
Parameters
Type |
Name |
Description |
bool |
createExplosion |
|
|
Edit this page
View Source
Destroy()
Destroys the element, triggering the Destroyed event.
Declaration
public override bool Destroy()
Returns
Type |
Description |
bool |
A bool indicating whether the element is destroyed, false if it was already destroyed prior to this call.
|
Overrides
|
Edit this page
View Source
DetachFromTower(bool)
Declaration
public void DetachFromTower(bool updateCounterpart = true)
Parameters
Type |
Name |
Description |
bool |
updateCounterpart |
|
|
Edit this page
View Source
DetachTrailer(bool)
Declaration
public void DetachTrailer(bool updateCounterpart = true)
Parameters
Type |
Name |
Description |
bool |
updateCounterpart |
|
|
Edit this page
View Source
Fix()
Declaration
|
Edit this page
View Source
GetDoorOpenRatio(VehicleDoor)
Declaration
public float GetDoorOpenRatio(VehicleDoor door)
Parameters
Returns
|
Edit this page
View Source
GetDoorState(VehicleDoor)
Declaration
public VehicleDoorState GetDoorState(VehicleDoor door)
Parameters
Returns
|
Edit this page
View Source
GetFreePassengerSeat()
Declaration
public byte? GetFreePassengerSeat()
Returns
|
Edit this page
View Source
GetLightState(VehicleLight)
Declaration
public VehicleLightState GetLightState(VehicleLight light)
Parameters
Returns
|
Edit this page
View Source
GetMaxPassengers()
Declaration
public byte GetMaxPassengers()
Returns
|
Edit this page
View Source
GetOccupantInSeat(byte)
Declaration
public Ped? GetOccupantInSeat(byte seat)
Parameters
Type |
Name |
Description |
byte |
seat |
|
Returns
|
Edit this page
View Source
GetPanelState(VehiclePanel)
Declaration
public VehiclePanelState GetPanelState(VehiclePanel panel)
Parameters
Returns
|
Edit this page
View Source
GetWheelState(VehicleWheel)
Declaration
public VehicleWheelState GetWheelState(VehicleWheel wheel)
Parameters
Returns
|
Edit this page
View Source
Jack(Ped, Ped)
Declaration
public void Jack(Ped previousDriver, Ped newDriver)
Parameters
Type |
Name |
Description |
Ped |
previousDriver |
|
Ped |
newDriver |
|
|
Edit this page
View Source
RemovePassenger(Ped, bool)
Declaration
public void RemovePassenger(Ped ped, bool warpsOut = true)
Parameters
Type |
Name |
Description |
Ped |
ped |
|
bool |
warpsOut |
|
|
Edit this page
View Source
ResetDoorsWheelsPanelsLights()
Declaration
public void ResetDoorsWheelsPanelsLights()
|
Edit this page
View Source
Respawn()
Declaration
|
Edit this page
View Source
SetDoorOpenRatio(VehicleDoor, float, uint)
Declaration
public void SetDoorOpenRatio(VehicleDoor door, float ratio, uint time = 0)
Parameters
|
Edit this page
View Source
SetDoorState(VehicleDoor, VehicleDoorState, bool)
Declaration
public void SetDoorState(VehicleDoor door, VehicleDoorState state, bool spawnFlyingComponent = false)
Parameters
|
Edit this page
View Source
SetLightState(VehicleLight, VehicleLightState)
Declaration
public void SetLightState(VehicleLight light, VehicleLightState state)
Parameters
|
Edit this page
View Source
SetPanelState(VehiclePanel, VehiclePanelState)
Declaration
public void SetPanelState(VehiclePanel panel, VehiclePanelState state)
Parameters
|
Edit this page
View Source
SetWheelState(VehicleWheel, VehicleWheelState)
Declaration
public void SetWheelState(VehicleWheel wheel, VehicleWheelState state)
Parameters
|
Edit this page
View Source
Spawn(Vector3, Vector3)
Declaration
public void Spawn(Vector3 position, Vector3 rotation)
Parameters
|
Edit this page
View Source
TriggerPushed(Player)
Declaration
public void TriggerPushed(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Events
|
Edit this page
View Source
AreDoorsDamageProofChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? AreDoorsDamageProofChanged
Event Type
|
Edit this page
View Source
AreSirensOnChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? AreSirensOnChanged
Event Type
|
Edit this page
View Source
Blown
Declaration
public event ElementEventHandler<VehicleBlownEventArgs>? Blown
Event Type
|
Edit this page
View Source
ColorChanged
Declaration
public event ElementEventHandler<Vehicle, VehicleColorChangedEventsArgs>? ColorChanged
Event Type
|
Edit this page
View Source
DoorOpenRatioChanged
Declaration
public event ElementEventHandler<VehicleDoorOpenRatioChangedArgs>? DoorOpenRatioChanged
Event Type
|
Edit this page
View Source
DoorStateChanged
Declaration
public event ElementEventHandler<VehicleDoorStateChangedArgs>? DoorStateChanged
Event Type
|
Edit this page
View Source
EngineStateChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? EngineStateChanged
Event Type
|
Edit this page
View Source
Fixed
Declaration
public event ElementEventHandler<VehicleFixedEventArgs>? Fixed
Event Type
|
Edit this page
View Source
FuelTankExplodableChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? FuelTankExplodableChanged
Event Type
|
Edit this page
View Source
HandlingChanged
Declaration
public event ElementChangedEventHandler<Vehicle, VehicleHandling?>? HandlingChanged
Event Type
|
Edit this page
View Source
HeadlightColorChanged
Declaration
public event ElementChangedEventHandler<Vehicle, Color>? HeadlightColorChanged
Event Type
|
Edit this page
View Source
HealthChanged
Declaration
public event ElementChangedEventHandler<Vehicle, float>? HealthChanged
Event Type
|
Edit this page
View Source
IsDamageProofChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? IsDamageProofChanged
Event Type
|
Edit this page
View Source
IsDerailableChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? IsDerailableChanged
Event Type
|
Edit this page
View Source
IsDerailedChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? IsDerailedChanged
Event Type
|
Edit this page
View Source
IsInWaterChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? IsInWaterChanged
Event Type
|
Edit this page
View Source
Jacked
Declaration
public event ElementEventHandler<Vehicle, VehicleJackedEventArgs>? Jacked
Event Type
|
Edit this page
View Source
LandingGearChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? LandingGearChanged
Event Type
|
Edit this page
View Source
LightStateChanged
Declaration
public event ElementEventHandler<VehicleLightStateChangedArgs>? LightStateChanged
Event Type
|
Edit this page
View Source
LockedStateChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? LockedStateChanged
Event Type
|
Edit this page
View Source
ModelChanged
Declaration
public event ElementChangedEventHandler<Vehicle, ushort>? ModelChanged
Event Type
|
Edit this page
View Source
OverrideLightsChanged
Declaration
public event ElementChangedEventHandler<Vehicle, VehicleOverrideLights>? OverrideLightsChanged
Event Type
|
Edit this page
View Source
PaintJobChanged
Declaration
public event ElementChangedEventHandler<Vehicle, byte>? PaintJobChanged
Event Type
|
Edit this page
View Source
PanelStateChanged
Declaration
public event ElementEventHandler<VehiclePanelStateChangedArgs>? PanelStateChanged
Event Type
|
Edit this page
View Source
PedEntered
Declaration
public event ElementEventHandler<VehicleEnteredEventsArgs>? PedEntered
Event Type
|
Edit this page
View Source
PedLeft
Declaration
public event ElementEventHandler<VehicleLeftEventArgs>? PedLeft
Event Type
|
Edit this page
View Source
PlateTextChanged
Declaration
public event ElementChangedEventHandler<Vehicle, string>? PlateTextChanged
Event Type
|
Edit this page
View Source
Pushed
Declaration
public event ElementEventHandler<Vehicle, VehiclePushedEventArgs>? Pushed
Event Type
|
Edit this page
View Source
Respawned
Declaration
public event ElementEventHandler<VehicleRespawnEventArgs>? Respawned
Event Type
|
Edit this page
View Source
SirenUpdated
Declaration
public event ElementEventHandler<Vehicle, VehicleSirenUpdatedEventArgs>? SirenUpdated
Event Type
|
Edit this page
View Source
SirensChanged
Declaration
public event ElementChangedEventHandler<Vehicle, VehicleSirenSet?>? SirensChanged
Event Type
|
Edit this page
View Source
SyncerChanged
Declaration
public event ElementChangedEventHandler<Vehicle, Player?>? SyncerChanged
Event Type
|
Edit this page
View Source
TaxiLightStateChanged
Declaration
public event ElementChangedEventHandler<Vehicle, bool>? TaxiLightStateChanged
Event Type
|
Edit this page
View Source
TowedVehicleChanged
Declaration
public event ElementChangedEventHandler<Vehicle, Vehicle?>? TowedVehicleChanged
Event Type
|
Edit this page
View Source
TowingVehicleChanged
Declaration
public event ElementChangedEventHandler<Vehicle, Vehicle?>? TowingVehicleChanged
Event Type
|
Edit this page
View Source
TrainDirectionChanged
Declaration
public event ElementChangedEventHandler<Vehicle, TrainDirection>? TrainDirectionChanged
Event Type
|
Edit this page
View Source
TurretRotationChanged
Declaration
public event ElementChangedEventHandler<Vehicle, Vector2?>? TurretRotationChanged
Event Type
|
Edit this page
View Source
UpgradeChanged
Declaration
public event ElementEventHandler<Vehicle, VehicleUpgradeChanged>? UpgradeChanged
Event Type
|
Edit this page
View Source
VariantsChanged
Declaration
public event ElementChangedEventHandler<Vehicle, VehicleVariants>? VariantsChanged
Event Type
|
Edit this page
View Source
WheelStateChanged
Declaration
public event ElementEventHandler<VehicleWheelStateChangedArgs>? WheelStateChanged
Event Type
Extension Methods