GE Lua Documentation

Press F to search!

onVehicleActiveChanged

Definition


-- @/lua/ge/extensions/gameplay/traffic.lua:584

local function onVehicleActiveChanged(vehId, active)
  if traffic[vehId] and traffic[vehId].isAi then
    if not active then
      traffic[vehId]._teleport = true
      traffic[vehId].alpha = 0
      getObjectByID(vehId):setMeshAlpha(0, '')
    else
      if traffic[vehId]._teleport then -- force teleport if flag exists
        if gameplay_traffic_trafficUtils.checkSpawnPoint(traffic[vehId].pos) then -- if current position is safe, then no teleport needed
          traffic[vehId]:onRefresh()
        else
          forceTeleport(vehId, nil, nil, traffic[vehId]._teleportDist)
        end
      end
    end
  end
end

Callers

@/lua/ge/extensions/gameplay/rally.lua

local function onVehicleActiveChanged(vehicleID, active)
  -- log('D', logTag, 'onVehicleActiveChanged')
@/lua/ge/extensions/gameplay/parking.lua

local function onVehicleActiveChanged(vehId, active)
  if vehPool and parkedVehData[vehId] then
@/lua/ge/extensions/core/vehicleActivePooling.lua

local function onVehicleActiveChanged(vehId, active)
  for _, pool in pairs(pools) do
@/lua/ge/extensions/freeroam/specialTriggers.lua

local function onVehicleActiveChanged(vehId, active)
  if not M.active then return end
@/lua/ge/extensions/core/trailerRespawn.lua

local function onVehicleActiveChanged(vehId, active)
  -- sets the vehicle's trailer visibility state to match the owner
@/lua/ge/extensions/gameplay/rallyLoop.lua

-- local function onVehicleActiveChanged(vehicleID, active)
  -- log('D', logTag, 'onVehicleActiveChanged')