Vehicle
This is a list of all methods only available for vehicles. It is also possible to call Entity functions on vehicles.
Methods
Vector Vehicle:CheckExitPoint( number yaw, number distance )
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:GetHLSpeed()
Returns the current speed of the vehicle in Half-Life Hammer Units (in/s). Same as Entity:GetVelocity + Vector:Length.
Entity Vehicle:GetPassenger( number passenger )
Gets the passenger of the vehicle, returns NULL if no drivers is present.
Vector, Angle Vehicle:GetPassengerSeatPoint( number role )
Returns the seat position and angle of a given passenger seat.
number Vehicle:GetRPM()
Returns the current RPM of the vehicle. This value is fake and doesn't actually affect the vehicle movement.
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.
Vector, Angle, number Vehicle:GetVehicleViewPosition( number role = 0 )
Returns the view position and forward angle of a given passenger seat.
Vector, number, boolean Vehicle:GetWheelContactPoint( number wheel )
Returns the wheel contact point.
boolean Vehicle:HasBrakePedal()
Returns whether this vehicle has a brake pedal. See Vehicle:SetHasBrakePedal.
boolean Vehicle:IsEngineEnabled()
Returns whether the engine is enabled or not, i.e. whether it can be started.
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 )
Vehicle:SetBoost( number boost )
Sets the boost. It is possible that this function does not work while the vehicle has a valid driver in it.
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:SetSteering( number front, number rear )
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: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 Structures/VehicleParams can be set.
Vehicle:SetWheelFriction( number wheel, number friction )
Sets friction of given wheel. This function may be broken.