GetVehicleUpgradeSlotName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function returns the name of an upgrade slot name ( | This function returns the name of an upgrade slot name (e.g. roof, spoiler). | ||
==Syntax== | ==Syntax== | ||
There are two ways of using this function, the parameter can either be the slot | There are two ways of using this function, the parameter can either be the slot ID (0 to 16) or the upgrade ID (1000 to 1193) | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getVehicleUpgradeSlotName ( slot | string getVehicleUpgradeSlotName ( int slot/upgrade ) | ||
</syntaxhighlight> | |||
</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''slot/upgrade:''' the slot ID or upgrade ID of which you want the name. | |||
*'''slot/ | |||
===Returns=== | ===Returns=== | ||
Returns the slot name if a valid slot or upgrade | Returns a ''string'' with the slot name if a valid slot or upgrade ID was given, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example prints | This example prints the name and upgrades on each slot of an entered vehicle to the chat. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) | addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) |
Revision as of 00:16, 24 March 2007
This function returns the name of an upgrade slot name (e.g. roof, spoiler).
Syntax
There are two ways of using this function, the parameter can either be the slot ID (0 to 16) or the upgrade ID (1000 to 1193)
string getVehicleUpgradeSlotName ( int slot/upgrade )
Required Arguments
- slot/upgrade: the slot ID or upgrade ID of which you want the name.
Returns
Returns a string with the slot name if a valid slot or upgrade ID was given, false otherwise.
Example
This example prints the name and upgrades on each slot of an entered vehicle to the chat.
addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) function onPlayerEnterVehicle ( vehicle, seat, jacked ) upgrades = getVehicleUpgrades ( vehicle ) for upgradeKey, upgradeValue in upgrades do outputChatBox ( getVehicleUpgradeSlotName ( upgradeKey - 1 ) .. ": " .. upgradeValue ) 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