onVehicleActiveChanged
Definition
-- @/lua/ge/extensions/core/trailerRespawn.lua:141
local function onVehicleActiveChanged(vehId, active)
-- sets the vehicle's trailer visibility state to match the owner
if trailerReg[vehId] then
getObjectByID(trailerReg[vehId].trailerId):setActive(active and 1 or 0)
log("D", logTag, "Trailer "..tostring(trailerReg[vehId].trailerId).." active state set to "..tostring(active))
if active then
local vehCouplerOffset = core_vehicles.vehsCouplerOffset[vehId][trailerReg[vehId].node]
local trailerCouplerOffset = core_vehicles.vehsCouplerOffset[trailerReg[vehId].trailerId][trailerReg[vehId].trailerNode]
local vehCouplerTag = core_vehicles.vehsCouplerTags[vehId][trailerReg[vehId].node]
spawn.placeTrailer(vehId, vehCouplerOffset, trailerReg[vehId].trailerId, trailerCouplerOffset, vehCouplerTag)
end
end
end
Callers
@/lua/ge/extensions/gameplay/traffic.lua
local function onVehicleActiveChanged(vehId, active)
if traffic[vehId] and traffic[vehId].isAi then
@/lua/ge/extensions/gameplay/rallyLoop.lua
-- local function onVehicleActiveChanged(vehicleID, active)
-- log('D', logTag, 'onVehicleActiveChanged')
@/lua/ge/extensions/freeroam/specialTriggers.lua
local function onVehicleActiveChanged(vehId, active)
if not M.active then return end
@/lua/ge/extensions/gameplay/rally.lua
local function onVehicleActiveChanged(vehicleID, active)
-- log('D', logTag, 'onVehicleActiveChanged')
@/lua/ge/extensions/core/vehicleActivePooling.lua
local function onVehicleActiveChanged(vehId, active)
for _, pool in pairs(pools) do
@/lua/ge/extensions/gameplay/parking.lua
local function onVehicleActiveChanged(vehId, active)
if vehPool and parkedVehData[vehId] then