GetVehiclesOfType
Jump to navigation
Jump to search
This function scans through all the current vehicles and returns the ones matching the given model.
Syntax
table getVehiclesOfType ( int model )
OOP Syntax Help! I don't understand this!
- Note: This function is a static function underneath the Vehicle class.
- Method: Vehicle.getAllOfType(...)
Required Arguments
- model: The model of vehicles you want.
Returns
Returns a table of existing vehicles matching the specified model.
Example
This example finds all landstalkers on the map and moves them 5 units to the left.
-- Find all the vehicles with the model 400 (landstalker) vehicles = getVehiclesOfType ( 400 ) -- Loop through the vehicle list for vehicleKey, vehicleValue in ipairs ( vehicles ) do -- Get the vehicle's position x, y, z = getElementPosition ( vehicleValue ) -- Move the vehicle to the left setElementPosition ( vehicleValue, x - 5, y, z ) end
See Also
- addVehicleSirens
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle