RemoveVehicleUpgrade: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | __NOTOC__ | ||
==Description== | ==Description== | ||
This function removes an already existing upgrade from the specified vehicle, eg: nos, | This function removes an already existing upgrade from the specified vehicle, eg: nos, hydraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool removeVehicleUpgrade ( vehicle, upgrade )</syntaxhighlight> | <syntaxhighlight lang="lua">bool removeVehicleUpgrade ( vehicle theVehicle, int upgrade )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theVehicle''': The [[element]] representing the [[vehicle]] you wish to remove the upgrade from | ||
*'''upgrade''': The upgrade you wish to remove, currently limited to NOS-5X(1008), NOS-2X(1009), NOS-10X(1010), HYDRAULICS(1087) | *'''upgrade''': The upgrade you wish to remove, currently limited to NOS-5X (1008), NOS-2X (1009), NOS-10X (1010), HYDRAULICS (1087) | ||
==Returns== | ==Returns== | ||
Returns 'true' if the upgrade was successfully removed from the vehicle, otherwise 'false'. | Returns ''true'' if the upgrade was successfully removed from the vehicle, otherwise ''false''. | ||
==Example== | ==Example== | ||
This script defines a 'nos' console command that adds and immediately removes a NOS upgrade to the vehicle that the player who executes the command is sitting in. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function addNOS ( sourcePlayer, command ) | |||
function | theVehicle = getPlayerOccupiedVehicle ( sourcePlayer ) | ||
if ( theVehicle ) then | |||
addVehicleUpgrade ( theVehicle, 1010 ) -- NOS 10x | |||
removeVehicleUpgrade ( theVehicle, 1010 ) | |||
if ( | |||
end | end | ||
end | end | ||
addCommandHandler ( "nos", addNOS ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Revision as of 17:55, 16 August 2007
Description
This function removes an already existing upgrade from the specified vehicle, eg: nos, hydraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.
Syntax
bool removeVehicleUpgrade ( vehicle theVehicle, int upgrade )
Required Arguments
- theVehicle: The element representing the vehicle you wish to remove the upgrade from
- upgrade: The upgrade you wish to remove, currently limited to NOS-5X (1008), NOS-2X (1009), NOS-10X (1010), HYDRAULICS (1087)
Returns
Returns true if the upgrade was successfully removed from the vehicle, otherwise false.
Example
This script defines a 'nos' console command that adds and immediately removes a NOS upgrade to the vehicle that the player who executes the command is sitting in.
function addNOS ( sourcePlayer, command ) theVehicle = getPlayerOccupiedVehicle ( sourcePlayer ) if ( theVehicle ) then addVehicleUpgrade ( theVehicle, 1010 ) -- NOS 10x removeVehicleUpgrade ( theVehicle, 1010 ) end end addCommandHandler ( "nos", addNOS )
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