Vehicle Components: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added a client-side code that shows you all the components of the vehicle you are in / on.)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 101: Line 101:
|style="background:#cfcfcf;"|Rear tire
|style="background:#cfcfcf;"|Rear tire
|-
|-
|style="background:#cfcfcf;"|whee_front
|style="background:#cfcfcf;"|wheel_front
|style="background:#cfcfcf;"|Front Tire
|style="background:#cfcfcf;"|Front Tire
|-
|-
Line 142: Line 142:
if sx and sy then
if sx and sy then
dxDrawRectangle(sx,sy, 10, 10)
dxDrawRectangle(sx,sy, 10, 10)
dxDrawLine(sx, sy, sx-100, sy-200)
dxDrawLine(sx, sy, sx - (100 + (countTest * 5)), sy-(200+ (countTest * 10)))
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" )
Line 160: Line 160:
*[[setVehicleComponentRotation]]
*[[setVehicleComponentRotation]]
*[[setVehicleComponentScale]]
*[[setVehicleComponentScale]]
<br>
 
 
*[[resetVehicleComponentPosition]]
*[[resetVehicleComponentPosition]]
*[[resetVehicleComponentRotation]]
*[[resetVehicleComponentRotation]]
*[[resetVehicleComponentScale]]
*[[resetVehicleComponentScale]]
<br>
 
 
*[[getVehicleComponents]]
*[[getVehicleComponents]]
*[[getVehicleComponentVisible]]
*[[getVehicleComponentVisible]]
Line 171: Line 173:
*[[getVehicleComponentPosition]]
*[[getVehicleComponentPosition]]


 
== See Also ==
==Vehicle functions==
* [[Vehicle]]
{{Client_vehicle_functions}}
* [[Vehicle IDs]]
* [[Template:Vehicle functions|Vehicle functions]]
* [[id|ID Lists]]

Latest revision as of 07:19, 1 January 2022

This page aims to provide an overview of vehicle components. The list is currently incomplete.

[[{{{image}}}|link=|]] Note: Changing wheel position on Z axis doesn't work.


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


[[{{{image}}}|link=|]] Note: Vehicles in the 'bike' category have 8 different components from the others, so a separate table was created..


An illustrative image showing the components of the bike.

Many different:

Component Name Description
chassis_dummy Vehicle chassis
plate_rear Back plate
handlebars Handlebars
mudguard Mudguard
wheel_rear Rear tire
wheel_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 [-]
Client
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 + (countTest * 5)), sy-(200+ (countTest * 10)))
				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



See Also