Click or drag to resize
BaseVehicle Class
Represents a SA-MP vehicle.
Inheritance Hierarchy
SystemObject
  SampSharp.GameMode.ToolsDisposable
    SampSharp.GameMode.PoolsIdentifiedPoolBaseVehicle
      SampSharp.GameMode.WorldBaseVehicle

Namespace: SampSharp.GameMode.World
Assembly: SampSharp.GameMode (in SampSharp.GameMode.dll) Version: 0.7.6221.37952
Syntax
public class BaseVehicle : IdentifiedPool<BaseVehicle>, 
	IWorldObject

The BaseVehicle type exposes the following members.

Constructors
  NameDescription
Public methodBaseVehicle
Initializes a new instance of the BaseVehicle class
Top
Properties
  NameDescription
Public propertyAlarm
Gets or sets this BaseVehicle's alarm state. If True the alarm is (or was) sounding.
Public propertyAngle
Gets or sets the Z angle of this BaseVehicle.
Public propertyBonnet
Gets or sets the bonnet/hood status of this BaseVehicle. If True, it's open.
Public propertyBoot
Gets or sets the boot/trunk status of this BaseVehicle. True means it is open.
Public propertyDoors
Gets or sets the lock status of the doors of this BaseVehicle. If True the doors are locked.
Public propertyDriver
Gets the driver of this BaseVehicle.
Public propertyEngine
Gets or sets this BaseVehicle's engine status. If True, the engine is running.
Public propertyHasTrailer
Gets whether this BaseVehicle has a trailer attached to it.
Public propertyHealth
Gets or sets the health of this BaseVehicle.
Public propertyId
Gets the identifier of this instance.
(Inherited from IdentifiedPoolTInstance.)
Public propertyIsBackLeftDoorOpen
Gets or sets a value indicating whether the driver door is open.
Public propertyIsBackLeftWindowClosed
Gets or sets a value indicating whether the driver window is closed.
Public propertyIsBackRightDoorOpen
Gets or sets a value indicating whether the driver door is open.
Public propertyIsBackRightWindowClosed
Gets or sets a value indicating whether the driver window is closed.
Public propertyIsDisposed
Gets whether this resource has been disposed.
(Inherited from Disposable.)
Public propertyIsDriverDoorOpen
Gets or sets a value indicating whether the driver door is open.
Public propertyIsDriverWindowClosed
Gets or sets a value indicating whether the driver window is closed.
Public propertyIsPassengerDoorOpen
Gets or sets a value indicating whether the passenger door is open.
Public propertyIsPassengerWindowClosed
Gets or sets a value indicating whether the passenger window is closed.
Public propertyIsSirenOn
Gets a value indicating whether this Vehicle's siren is on.
Public propertyIsValid
Gets whether this BaseVehicle has been created and still is alive.
Public propertyLights
Gets or sets this BaseVehicle's lights' state. If True the lights are on.
Public propertyModel
Gets the model ID of this BaseVehicle.
Public propertyModelInfo
Gets an instance of VehicleModelInfo about this BaseVehicle.
Public propertyObjective
Gets or sets the objective status of this BaseVehicle. True means the objective is on.
Public propertyPassengers
Gets the passengers of this BaseVehicle. (not the driver)
Public propertyStatic memberPoolSize
Gets the size of the vehicles pool.
Public propertyPosition
Gets or sets the position of this BaseVehicle.
Public propertyRotation
Gets or sets the rotation of this BaseVehicle.
Public propertyTrailer
Gets or sets the the trailer attached to this BaseVehicle.
Public propertyVelocity
Gets or sets the velocity at which this BaseVehicle is moving.
Public propertyVirtualWorld
Gets or sets the virtual world of this BaseVehicle.
Top
Methods
  NameDescription
Public methodAddComponent
Adds a 'component' (often referred to as a 'mod' (modification)) to this Vehicle.
Protected methodAssertNotDisposed
Checks whether this instance has been disposed. If it has, it throws an exception.
(Inherited from Disposable.)
Public methodChangeColor
Change this BaseVehicle's primary and secondary colors.
Public methodChangePaintjob
Change this BaseVehicle's paintjob (for plain colors see ChangeColor(Int32, Int32)).
Public methodStatic memberCreate
Creates a BaseVehicle in the world.
Public methodStatic memberCreateStatic(VehicleModelType, Vector3, Single, Int32, Int32)
Creates a static BaseVehicle in the world.
Public methodStatic memberCreateStatic(VehicleModelType, Vector3, Single, Int32, Int32, Int32, Boolean)
Creates a static BaseVehicle in the world.
Public methodDispose
Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from Disposable.)
Protected methodDispose(Boolean)
Removes this instance from the pool.
(Overrides IdentifiedPoolTInstanceDispose(Boolean).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Finalizes an instance of the Disposable class.
(Inherited from Disposable.)
Public methodGetComponentInSlot
Retrieves the installed component ID from this BaseVehicle in a specific slot.
Public methodStatic memberGetComponentType
Find out what type of component a certain ID is.
Public methodGetDamageStatus
Retrieve the damage statuses of this BaseVehicle.
Public methodGetDistanceFromPoint
This function can be used to calculate the distance (as a float) between this BaseVehicle and another map coordinate. This can be useful to detect how far a vehicle away is from a location.
Public methodGetDoorsParameters(Boolean, Boolean, Boolean, Boolean)
Gets the doors parameters.
Public methodGetDoorsParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Gets the doors parameters.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetModelInfo
Retrieve information about a specific vehicle model such as the size or position of seats.
Public methodGetParameters(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Gets this BaseVehicle's parameters.
Public methodGetParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Gets this BaseVehicle's parameters.
Public methodGetRotationQuat
Returns this BaseVehicle's rotation on all axis as a quaternion.
Public methodGetRotationQuat(Single, Single, Single, Single)
Returns this BaseVehicle's rotation on all axis as a quaternion.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWindowsParameters(Boolean, Boolean, Boolean, Boolean)
Gets the windows parameters.
Public methodGetWindowsParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Gets the windows parameters.
Protected methodInitialize
An overloadable point for initialization logic which requires the Id to be set.
(Inherited from IdentifiedPoolTInstance.)
Public methodIsStreamedIn
Checks if this BaseVehicle is streamed in for a BasePlayer.
Public methodLinkToInterior
Links this BaseVehicle to the interior. This can be used for example for an arena/stadium.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnDamageStatusUpdated
Raises the DamageStatusUpdated event.
Public methodOnDeath
Raises the Died event.
Public methodOnMod
Raises the Mod event.
Public methodOnPaintjobApplied
Raises the PaintjobApplied event.
Public methodOnPlayerEnter
Raises the PlayerEnter event.
Public methodOnPlayerExit
Raises the PlayerExit event.
Public methodOnResprayed
Raises the Resprayed event.
Public methodOnSirenStateChanged
Raises the SirenStateChanged event.
Public methodOnSpawn
Raises the Spawn event.
Public methodOnStreamIn
Raises the StreamIn event.
Public methodOnStreamOut
Raises the StreamOut event.
Public methodOnTrailerUpdate
Raises the TrailerUpdate event.
Public methodOnUnoccupiedUpdate
Raises the UnoccupiedUpdate event.
Public methodRemoveComponent
Remove a component from the BaseVehicle.
Public methodRepair
Fully repairs this BaseVehicle, including visual damage (bumps, dents, scratches, popped tires etc.).
Public methodRespawn
Sets this BaseVehicle back to the position at where it was created.
Public methodSetAngularVelocity
Sets the angular velocity of this BaseVehicle.
Public methodSetDoorsParameters(Boolean, Boolean, Boolean, Boolean)
Sets the doors parameters.
Public methodSetDoorsParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Sets the doors parameters.
Public methodSetNumberPlate
Set this BaseVehicle's numberplate, which supports olor embedding.
Public methodSetParameters(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Sets this BaseVehicle's parameters for all players.
Public methodSetParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Sets this BaseVehicle's parameters for all players.
Public methodSetParametersForPlayer
Set the parameters of this BaseVehicle for a BasePlayer.
Public methodSetWindowsParameters(Boolean, Boolean, Boolean, Boolean)
Sets the windows parameters.
Public methodSetWindowsParameters(VehicleParameterValue, VehicleParameterValue, VehicleParameterValue, VehicleParameterValue)
Sets the windows parameters.
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Public methodUpdateDamageStatus
Sets the various visual damage statuses of this BaseVehicle, such as popped tires, broken lights and damaged panels.
Top
Events
  NameDescription
Public eventDamageStatusUpdated
Occurs when the OnDamageStatusUpdated(PlayerEventArgs) is being called. This callback is called when a element of this BaseVehicle such as doors, tires, panels, or lights get damaged.
Public eventDied
Occurs when the OnDeath(PlayerEventArgs) is being called. This callback is called when this BaseVehicle is destroyed - either by exploding or becoming submerged in water.
Public eventDisposed
Occurs when this isntance has been disposed.
(Inherited from Disposable.)
Public eventMod
Occurs when the OnMod(VehicleModEventArgs) is being called. This callback is called when this BaseVehicle is modded.
Public eventPaintjobApplied
Occurs when the OnPaintjobApplied(VehiclePaintjobEventArgs) is being called. Called when a BasePlayer changes the paintjob of this BaseVehicle (in a modshop).
Public eventPlayerEnter
Occurs when the OnPlayerEnter(EnterVehicleEventArgs) is being called. This callback is called when a BasePlayer starts to enter this BaseVehicle, meaning the player is not in vehicle yet at the time this callback is called.
Public eventPlayerExit
Occurs when the OnPlayerExit(PlayerVehicleEventArgs) is being called. This callback is called when a BasePlayer exits a BaseVehicle.
Public eventResprayed
Occurs when the OnResprayed(VehicleResprayedEventArgs) is being called. The callback name is deceptive, this callback is called when a BasePlayer exits a mod shop with this BaseVehicle, regardless of whether the vehicle's colors were changed, and is NEVER called for pay 'n' spray garages.
Public eventSirenStateChanged
Occurs when the OnSirenStateChanged(SirenStateEventArgs) is being called. This callback is called when this BaseVehicle's siren is toggled.
Public eventSpawn
Occurs when the OnSpawn(EventArgs) is being called. This callback is called when BaseVehicle spawns.
Public eventStreamIn
Occurs when the OnStreamIn(PlayerEventArgs) is being called. Called when a BaseVehicle is streamed to a BasePlayer's client.
Public eventStreamOut
Occurs when the OnStreamOut(PlayerEventArgs) is being called. This callback is called when a BaseVehicle is streamed out from some BasePlayer's client.
Public eventTrailerUpdate
Occurs when the OnTrailerUpdate(TrailerEventArgs) is being called. This callback is called when a BasePlayer sent a trailer update about this BaseVehicle.
Public eventUnoccupiedUpdate
Occurs when the OnUnoccupiedUpdate(UnoccupiedVehicleEventArgs) is being called. This callback is called everytime this BaseVehicle updates the server with their status while it is unoccupied.
Top
Fields
  NameDescription
Public fieldStatic memberInvalidId
Identifier indicating the handle is invalid.
Public fieldStatic memberMax
Maximum number of vehicles which can exist.
Top
See Also