- Documentation
- Shared functions
- getVehicleComponentVisible
Function
getVehicleComponentVisible
Checks whether a named part of a vehicle model is visible. On the client it also takes this player's local settings into account.
Syntax
bool getVehicleComponentVisible(vehicle vehicle, string component)Arguments
vehiclevehicle- The vehicle.
componentstring- Part name.
Returns
true when visible (also for a part nobody changed).
Example
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle and not getVehicleComponentVisible(vehicle, "bonnet_dummy") then
outputChatBox("Maska jest schowana.")
end
See also
setVehicleComponentVisibleShows or hides a named part of a vehicle model. On the server the change applies to every player ; on the client it applies to the local player only and takes priority over the server's setting. It works on the frames of a model from a file (engineReplaceModel): the author's variants (spoiler_1,extra1…), doors, bonnet, bumpers. The client-sidegetVehicleComponentslists the names for a given vehicle.resetVehicleComponentVisibleClears the local (this player only) visibility setting of a vehicle part, so the state set by the server comes back. Without a part name it clears the local settings of all parts of the vehicle.