GE Lua Documentation

Press F to search!

freezeAll

Definition


-- @/lua/ge/extensions/scenario/scenarios.lua:56

-- freezing of the vehicles before the countdown is done
local function freezeAll(state)

  if not scenario then
    log('D', logTag, 'Freeze all did not find a scenario....')
    return
  end

  if scenario.vehicleNameToId then
    for k, vid in pairs(scenario.vehicleNameToId) do
      local bo = getObjectByID(vid)
      if bo then
        bo:queueLuaCommand('controller.setFreeze('..tostring(state) ..')')
      end
    end
  else
    log('W', logTag, 'There are no vehicles to freeze.')
  end
end

Callers

@/lua/ge/extensions/scenario/scenarios.lua

    freezeAll(1)
    commands.setGameCamera()
local function pauseScenario()
  -- freezeAll(1)
  simTimeAuthority.pause(true)
local function continueScenario()
  -- freezeAll(0)
  simTimeAuthority.pause(false)
      needFreezeVehicles = false
      freezeAll(1)
    end
      -- unlock all vehicles
      freezeAll(0)
    end
    freezeAll(1)
  end