-
Notifications
You must be signed in to change notification settings - Fork 1
Vehicle Events
Necroso edited this page Sep 16, 2022
·
7 revisions
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.
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.
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.