Element/Vehicle: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(add see also) |
||
(8 intermediate revisions by 7 users not shown) | |||
Line 6: | Line 6: | ||
==XML syntax== | ==XML syntax== | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<vehicle model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" color="" upgrades="" paintjob="" plate="" turretX="" turretY="" health="" sirens="" landingGearDown="" specialState="" locked="" interior="" dimension=""/> | <vehicle model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" color="" upgrades="" paintjob="" plate="" turretX="" turretY="" health="" sirens="" landingGearDown="" specialState="" locked="" interior="" dimension="" frozen=""/> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 19: | Line 19: | ||
* '''rotY''': A float representing the Y rotation of the vehicle. | * '''rotY''': A float representing the Y rotation of the vehicle. | ||
* '''rotZ''': A float representing the Z rotation of the vehicle. | * '''rotZ''': A float representing the Z rotation of the vehicle. | ||
* '''color''': An integer indicating the vehicle's [[ | * '''color''': An integer indicating the vehicle's [[Vehicle Colors|color(s)]] (seperated by commas). | ||
* '''upgrades''': An integer representing the vehicle's mod upgrade(s) (seperated by commas), defined in San Andreas\data\maps\veh_mods\veh_mods.ide | * '''upgrades''': An integer representing the vehicle's mod upgrade(s) (seperated by commas), defined in San Andreas\data\maps\veh_mods\veh_mods.ide | ||
* '''paintjob''': An integer indicating the vehicle's paint job (only works on certain vehicles). | * '''paintjob''': An integer indicating the vehicle's paint job (only works on certain vehicles). | ||
Line 28: | Line 28: | ||
* '''sirens''': whether or not the vehicle's sirens are on (e.g. police cars and ambulances). Possible values are "true" and "false". | * '''sirens''': whether or not the vehicle's sirens are on (e.g. police cars and ambulances). Possible values are "true" and "false". | ||
* '''landingGearDown''': whether or not the vehicle's landing gear is down (only applicable to planes). Possible values are "true" and "false". | * '''landingGearDown''': whether or not the vehicle's landing gear is down (only applicable to planes). Possible values are "true" and "false". | ||
* '''specialState''': the vehicle's adjustable property number. | |||
* '''locked''': whether or not the vehicle's doors are locked. "true" or "false". | * '''locked''': whether or not the vehicle's doors are locked. "true" or "false". | ||
* '''interior''': the interior number of the vehicle | * '''interior''': the interior number of the vehicle | ||
* '''dimension''': the dimension number of the vehicle | * '''dimension''': the dimension number of the vehicle | ||
{{New feature|3.0110|1.1| | |||
* '''frozen''': A bool indicating whether the vehicle should be capable of moving | |||
}} | |||
==Related scripting functions== | ==Related scripting functions== | ||
Line 36: | Line 40: | ||
[[Category:Element Types]] | [[Category:Element Types]] | ||
== See also == | |||
* [[Vehicle_IDs|Vehicle IDs]] | |||
* [[Id|Ids]] | |||
[[en:Element/Vehicle]] | |||
[[ru:Element/Vehicle]] | |||
[[hu:Element/Vehicle]] | |||
[[it:Elemento/Veicolo]] | [[it:Elemento/Veicolo]] |
Latest revision as of 06:57, 1 January 2022
The vehicle class represents vehicles in the GTA world. Vehicles can be occupied and controlled by players.
The element type of this class is "vehicle".
XML syntax
<vehicle model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" color="" upgrades="" paintjob="" plate="" turretX="" turretY="" health="" sirens="" landingGearDown="" specialState="" locked="" interior="" dimension="" frozen=""/>
Required Attributes
- model: The vehicle ID of the vehicle being created.
- posX: A float representing the X position of the vehicle.
- posY: A float representing the Y position of the vehicle.
- posZ: A float representing the Z position of the vehicle.
Optional Attributes
- rotX: A float representing the X rotation of the vehicle.
- rotY: A float representing the Y rotation of the vehicle.
- rotZ: A float representing the Z rotation of the vehicle.
- color: An integer indicating the vehicle's color(s) (seperated by commas).
- upgrades: An integer representing the vehicle's mod upgrade(s) (seperated by commas), defined in San Andreas\data\maps\veh_mods\veh_mods.ide
- paintjob: An integer indicating the vehicle's paint job (only works on certain vehicles).
- plate: A set of up to 8 characters that will be shown on the vehicle's license plate.
- turretX: the vehicle's turret's rotation around the Z axis, in radians. Relative to the vehicle's rotation, i.e. turretX=0 will always make the turret point in the same direction as the vehicle.
- turretY: the vehicle's turret's rotation around the X axis, in radians. 0 means horizontal, positive values will make it point up and negative values point it down.
- health: the vehicle's health. A value of 1000 means completely healthy, although higher values are allowed.
- sirens: whether or not the vehicle's sirens are on (e.g. police cars and ambulances). Possible values are "true" and "false".
- landingGearDown: whether or not the vehicle's landing gear is down (only applicable to planes). Possible values are "true" and "false".
- specialState: the vehicle's adjustable property number.
- locked: whether or not the vehicle's doors are locked. "true" or "false".
- interior: the interior number of the vehicle
- dimension: the dimension number of the vehicle
- frozen: A bool indicating whether the vehicle should be capable of moving
Related scripting functions
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates