ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehiclePanelState

Function

getVehiclePanelState

Server and clientVehiclesIdentical to MTA:SA

Returns the damage level of a body part (0 intact - 3 badly damaged). Numbering as in setVehiclePanelState.

Syntax

int getVehiclePanelState(vehicle vehicle, int panel)

Arguments

vehiclevehicle
The vehicle.
panelint
Part number 0-6.

Returns

State 0-3.

Example

addCommandHandler("szyba", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle and getVehiclePanelState(vehicle, 4) > 0 then
        outputChatBox("Przednia szyba jest pęknięta.", player)
    end
end)

See also