AddVehicleUpgrade: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''vehicle''': The [[element]] representing the [[vehicle]] you wish to add the upgrade to. | *'''vehicle''': The [[element]] representing the [[vehicle]] you wish to add the upgrade to. | ||
*'''upgrade''': The upgrade you wish to add, | *'''upgrade''': The upgrade you wish to add, currently limited to NOS-5X(1008), NOS-2X(1009), NOS-10X(1010), HYDRAULICS(1087) | ||
==Returns== | ==Returns== | ||
Line 17: | Line 17: | ||
addEventHandler ( "onPlayerConsole", root, "onPlayerConsole" ) | addEventHandler ( "onPlayerConsole", root, "onPlayerConsole" ) | ||
function onPlayerConsole ( text ) | function onPlayerConsole ( text ) | ||
command = split ( text, 1, 32 | command = split ( text, 1, 32 ) | ||
if ( command == "nos" ) then | if ( command == "nos" ) then | ||
vehicle = getPlayerOccupiedVehicle ( source ) | vehicle = getPlayerOccupiedVehicle ( source ) |
Revision as of 13:44, 10 June 2006
Description
This function adds an upgrade to an existing vehicle, eg: nos, hyrdraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.
Syntax
bool addVehicleUpgrade ( vehicle, upgrade )
Required Arguments
- vehicle: The element representing the vehicle you wish to add the upgrade to.
- upgrade: The upgrade you wish to add, currently limited to NOS-5X(1008), NOS-2X(1009), NOS-10X(1010), HYDRAULICS(1087)
Returns
Returns 'true' if the upgrade was successfully added to the vehicle, otherwise 'false'.
Example
addEventHandler ( "onPlayerConsole", root, "onPlayerConsole" ) function onPlayerConsole ( text ) command = split ( text, 1, 32 ) if ( command == "nos" ) then vehicle = getPlayerOccupiedVehicle ( source ) if ( vehicle ) then addVehicleUpgrade ( vehicle, 1010 ) -- nos-10x end end end
See Also
- 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