Vehicle Components: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Added a client-side code that shows you all the components of the vehicle you are in / on.) |
||
Line 72: | Line 72: | ||
|style="background:#cfcfcf;"|Exhausts | |style="background:#cfcfcf;"|Exhausts | ||
|} | |} | ||
==Bike Components | ==Bike Components== | ||
<br> | <br> | ||
{{Note|Vehicles in the 'bike' category have 8 different components from the others, so a separate table was created..}} | {{Note|Vehicles in the 'bike' category have 8 different components from the others, so a separate table was created..}} | ||
Line 125: | Line 125: | ||
|- | |- | ||
|} | |} | ||
==Code that shows all the components of the vehicle you are inside.== | |||
There are more components that are not yet in these tables above, and if you want to know all of them use this code below. This code works as follows: you enter / climb the vehicle and it will show you all the components as in the image above. | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
addEventHandler ( "onClientRender", root, | |||
function() | |||
countTest = 0 | |||
if isPedInVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) then | |||
local veh = getPedOccupiedVehicle ( localPlayer ) | |||
for v in pairs ( getVehicleComponents(veh) ) do | |||
countTest = countTest + 1 | |||
local x,y,z = getVehicleComponentPosition ( veh, v, "world" ) | |||
local sx,sy = getScreenFromWorldPosition ( x, y, z ) | |||
if sx and sy then | |||
dxDrawRectangle(sx,sy, 10, 10) | |||
dxDrawLine(sx, sy, sx-100, sy-200) | |||
dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) -1, 0 -1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) | |||
dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) -1, 0 +1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) | |||
dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) +1, 0 -1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) | |||
dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) +1, 0 +1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) | |||
dxDrawText ( v, (sx-(120 + (countTest * 5))), (sy-(220 + (countTest * 10))), 0, 0, tocolor(0,255,255), 1, "default-bold" ) | |||
end | |||
end | |||
end | |||
end) | |||
</syntaxhighlight> | |||
</section> | |||
==Related scripting functions== | ==Related scripting functions== |
Revision as of 15:02, 21 January 2021
This page aims to provide an overview of vehicle components. The list is currently incomplete.
Component Name | Description |
---|---|
boot_dummy | Trunk door |
ug_nitro | Nitro (tuning part) |
wheel_rf_dummy | Right Front Wheel |
wheel_lf_dummy | Left Front Wheel |
wheel_rb_dummy | Right Back Wheel |
wheel_lb_dummy | Left Back Wheel |
chassis | Chassis |
chassis_vlo | Chassis (lod)[Can't be hid] |
ug_roof | Roof [Can't be hid] |
door_rf_dummy | Right Front Door |
door_lf_dummy | Left Front Door |
door_rr_dummy | Right Back Door |
door_lr_dummy | Left Back Door |
bonnet_dummy | Hood |
ug_wing_right | Right wing (tuning part) [Can't be hid] |
bump_front_dummy | Front bumper |
bump_rear_dummy | Back bumper |
windscreen_dummy | Windscreen |
misc_a | Tow bar position on models: 514, 515, 403, 591, 552, 485, 583, 606, 607, 608. |
ug_wing_left | Leftwing (tuning part) [Can't be hid] |
exhaust_ok | Exhausts |
Bike Components
Many different:
Component Name | Description |
---|---|
chassis_dummy | Vehicle chassis |
plate_rear | Back plate |
handlebars | Handlebars |
mudguard | Mudguard |
wheel_rear | Rear tire |
whee_front | Front Tire |
froks_rear | Froks rear |
froks_front | Froks front |
Equals:
Component Name |
---|
chassis |
chassis_vlo |
Code that shows all the components of the vehicle you are inside.
There are more components that are not yet in these tables above, and if you want to know all of them use this code below. This code works as follows: you enter / climb the vehicle and it will show you all the components as in the image above.
Click to collapse [-]
ClientaddEventHandler ( "onClientRender", root, function() countTest = 0 if isPedInVehicle ( localPlayer ) and getPedOccupiedVehicle ( localPlayer ) then local veh = getPedOccupiedVehicle ( localPlayer ) for v in pairs ( getVehicleComponents(veh) ) do countTest = countTest + 1 local x,y,z = getVehicleComponentPosition ( veh, v, "world" ) local sx,sy = getScreenFromWorldPosition ( x, y, z ) if sx and sy then dxDrawRectangle(sx,sy, 10, 10) dxDrawLine(sx, sy, sx-100, sy-200) dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) -1, 0 -1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) -1, 0 +1, 0 -1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, (sx-(120 + (countTest * 5))) -1, (sy-(220 + (countTest * 10))) +1, 0 -1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, (sx-(120 + (countTest * 5))) +1, (sy-(220 + (countTest * 10))) +1, 0 +1, 0 +1, tocolor(0,0,0), 1, "default-bold" ) dxDrawText ( v, (sx-(120 + (countTest * 5))), (sy-(220 + (countTest * 10))), 0, 0, tocolor(0,255,255), 1, "default-bold" ) end end end end)
Related scripting functions
- setVehicleComponentVisible
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- getVehicleComponents
- getVehicleComponentVisible
- getVehicleComponentScale
- getVehicleComponentRotation
- getVehicleComponentPosition
Vehicle functions
- areVehicleLightsOn
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getVehicleAdjustableProperty
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleCurrentGear
- getVehicleDummyPosition
- getVehicleGravity
- getVehicleLandingGearDown
- getVehicleModelDummyDefaultPosition
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelWheelSize
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleWheelFrictionState
- getVehicleWheelScale
- isTrainChainEngine
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleWheelOnGround
- isVehicleWindowOpen
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- resetVehicleDummyPositions
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setVehicleAdjustableProperty
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDummyPosition
- setVehicleGravity
- setVehicleLandingGearDown
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleModelWheelSize
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleWheelScale
- setVehicleWheelStates
- setVehicleWindowOpen
- Shared
- 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