GetVehicleUpgradeOnSlot: Difference between revisions
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
This example prints the name and upgrades on each slot of an entered vehicle to the chat. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function scriptOnPlayerEnterVehicle ( theVehicle, seat, jacked ) | |||
for i=0, 16 do | |||
local upgrade = getVehicleUpgradeOnSlot ( i ) | |||
if ( upgrade ) then | |||
tputChatBox ( getVehicleUpgradeSlotName ( i ) .. ": " .. upgrade) | |||
end | |||
end | |||
end | |||
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), scriptOnPlayerEnterVehicle ) | |||
end</syntaxhighlight> | end</syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} |
Revision as of 11:19, 13 August 2007
Description
This function returns the current upgrade id on the specified vehicle's 'upgrade slot' An upgrade slot is a certain type of upgrade (eg: exhaust, spoiler), there are 17 slots (0 to 16).
Syntax
getVehicleUpgradeOnSlot ( vehicle, slot )
Required Arguments
- vehicle: The vehicle whose upgrade you want to retrieve.
- slot: The slot id of the upgrade.
Example
Click to collapse [-]
ServerThis example prints the name and upgrades on each slot of an entered vehicle to the chat.
function scriptOnPlayerEnterVehicle ( theVehicle, seat, jacked ) for i=0, 16 do local upgrade = getVehicleUpgradeOnSlot ( i ) if ( upgrade ) then tputChatBox ( getVehicleUpgradeSlotName ( i ) .. ": " .. upgrade) end end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), scriptOnPlayerEnterVehicle ) 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