Skip to content
Necroso edited this page Sep 16, 2022 · 7 revisions

onVehicleUpdate

Description: This event is called when the vehicle has update change.

Parameters:

onVehicleUpdate(Vehicle vehicle, int updateType)

Example:

function onVehicleUpdate(vehicle, updateType)
    -- Detect health change
    if(updateType == 4) then
        Player.msgAll("Vehicle " .. vehicle:getID() .. " has a new health change: " .. vehicle.health .. "%")
    end
end
  • vehicle: The updated vehicle.
  • updateType: The type of the update.

onVehicleExplode

Description: This event is called when a vehicle explodes.

Parameters:

onVehicleExplode(Vehicle vehicle)

Example:

function onVehicleExplode(vehicle)
    local districtName = Map.getDistrictName(vehicle.position)
    Player.msgAll("Vehicle " .. vehicle:getID() .. " exploded in " .. districtName  .. ".")
end
  • vehicle: The exploded vehicle.

onVehicleRespawn

Description: This event is called when a vehicle respawns.

Parameters:

onVehicleRespawn(Vehicle vehicle)

Example:

function onVehicleRespawn(vehicle)
    local districtName = Map.getDistrictName(vehicle.position)
    Player.msgAll("Vehicle " .. vehicle:getID() .. " has respawned in " .. districtName  .. ".")
end
  • vehicle: The vehicle that respawned.

Clone this wiki locally