Garry's Mod Wiki

Vehicle:SetVehicleParams

  Vehicle:SetVehicleParams( table params )

Description

Sets the vehicle parameters for given vehicle.

Not all variables from the VehicleParams structure can be set.

Arguments

1 table params
The new new vehicle parameters. See VehicleParams structure.

Example

Adds 25 horsepower to every vehicle spawned.

hook.Add("PlayerSpawnedVehicle", "VehicleParamsExample", function(ply, entity) local params = entity:GetVehicleParams() params.engine.horsepower = params.engine.horsepower + 25 entity:SetVehicleParams(params) end)