Vehicle
This is a list of all methods only available for vehicles. It is also possible to call Entity functions on vehicles.
Inherits methods from Entity.
Methods
number Vehicle:BoostTimeLeft()
Returns the remaining boosting time left.
Tries to find an Exit Point for leaving vehicle, if one is unobstructed in the direction given.
Vehicle:EnableEngine( boolean enable )
Sets whether the engine is enabled or disabled, i. e. can be started or not.
number Vehicle:GetCameraDistance()
Returns third person camera distance.
number Vehicle:GetHLSpeed()
Returns the current speed of the vehicle in Half-Life Hammer Units (in/s). Same as Entity:GetVelocity + Vector:Length.
number Vehicle:GetMaxSpeed()
Returns the max speed of the vehicle in MPH.
table Vehicle:GetOperatingParams()
Returns some info about the vehicle.
Gets the passenger of the vehicle, returns NULL if no drivers is present.
Returns the seat position and angle of a given passenger seat.
Returns the current RPM of the vehicle. This value is fake and doesn't actually affect the vehicle movement.
number Vehicle:GetSteering()
Returns the current steering of the vehicle.
number Vehicle:GetSteeringDegrees()
Returns the maximum steering degree of the vehicle
boolean Vehicle:GetThirdPersonMode()
Returns if vehicle has thirdperson mode enabled or not.
number Vehicle:GetThrottle()
Returns the current throttle of the vehicle.
string Vehicle:GetVehicleClass()
Returns the vehicle class name. This is only useful for Sandbox spawned vehicles or any vehicle that properly sets the vehicle class with Vehicle:SetVehicleClass.
table Vehicle:GetVehicleParams()
Returns the vehicle parameters of given vehicle.
Returns the view position and forward angle of a given passenger seat.
Returns the base wheel height.
Returns the wheel contact point.
number Vehicle:GetWheelCount()
Returns the wheel count of the vehicle
Returns the total wheel height.
boolean Vehicle:HasBrakePedal()
Returns whether this vehicle has a brake pedal. See Vehicle:SetHasBrakePedal.
boolean Vehicle:IsBoosting()
Returns whether this vehicle is currently boosting or not.
boolean Vehicle:IsEngineEnabled()
Returns whether the engine is enabled or not, i. e. whether it can be started.
boolean Vehicle:IsEngineStarted()
Returns whether the engine is started or not.
boolean Vehicle:IsValidVehicle()
Returns true if the vehicle object is a valid or not. This will return false when Vehicle functions are not usable on the vehicle.
boolean Vehicle:IsVehicleBodyInWater()
Returns whether this vehicle's engine is underwater or not. ( Internally the attachment point "engine" or "vehicle_engine" is checked )
Vehicle:ReleaseHandbrake()
Releases the vehicle's handbrake (Jeep) so it can roll without any passengers.
This will be overwritten if the vehicle has a driver. Same as Vehicle:SetHandbrake( false )
Sets the boost. It is possible that this function does not work while the vehicle has a valid driver in it.
Vehicle:SetCameraDistance( number distance )
Sets the third person camera distance of the vehicle.
Vehicle:SetHandbrake( boolean handbrake )
Turns on or off the Jeep handbrake so it can roll without a driver inside.
Does nothing while the vehicle has a driver in it.
Vehicle:SetHasBrakePedal( boolean brakePedal )
Sets whether this vehicle has a brake pedal.
Vehicle:SetMaxReverseThrottle( number maxRevThrottle )
Sets maximum reverse throttle
Vehicle:SetMaxThrottle( number maxThrottle )
Sets maximum forward throttle
Sets spring length of given wheel
Sets the steering of the vehicle.
The correct range, 0 to 1 or -1 to 1
Vehicle:SetSteeringDegrees( number steeringDegrees )
Sets the maximum steering degrees of the vehicle
Vehicle:SetThirdPersonMode( boolean enable )
Sets the third person mode state.
Vehicle:SetThrottle( number throttle )
Sets the throttle of the vehicle. It is possible that this function does not work with a valid driver in it.
Vehicle:SetVehicleClass( string class )
This is used internally - although you're able to use it you probably shouldn't.
Sets the vehicle class name.
Vehicle:SetVehicleEntryAnim( boolean bOn )
Sets whether the entry or exit camera animation should be played or not.
Vehicle:SetVehicleParams( table params )
Sets the vehicle parameters for given vehicle.
Not all variables from the VehicleParams structure can be set.
Sets friction of given wheel. This function may be broken.
Vehicle:StartEngine( boolean start )
Starts or stops the engine.