GE Lua Documentation

Press F to search!

queueCallbackInVehicle

Definition


-- @/lua/ge/ge_utils.lua:832

-- NOTE: please consider using vehicleBridge API instead of queueCallbackInVehicle(), if possible
function queueCallbackInVehicle(veh, geluaFunctionName, vluaCommand, ...)
  if not veh or not geluaFunctionName or not vluaCommand then
    log("E", "", "Unable to queue callback, invalid parameters: "..dumps(veh, geluaFunctionName, vluaCommand))
    return
  end

  local geluaCommand = string.format('local args = %s; %s(unpack(args, 1, table.maxn(args)))', 'deserialize(%q)', geluaFunctionName)
  local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
  veh:queueLuaCommand(cmd)
end

Callers

@/lua/ge/extensions/career/modules/partShopping.lua
  function()
    queueCallbackInVehicle(getCurrentVehicleObj(), "career_modules_partShopping.updatePreviewVehicle", "partCondition.getConditions()")
  end
@/lua/ge/extensions/career/modules/partInventory.lua
  local vehicleObj = getObjectByID(vehObjId)
  queueCallbackInVehicle(vehicleObj, "career_modules_partInventory.changedPartsCallback", "partCondition.getConditions()", inventoryId)
end
    core_vehicles.replaceVehicle(carModelToLoad, vehicleData, vehicleObj)
    queueCallbackInVehicle(vehicleObj, "career_modules_partInventory.initConditionsCallback", "partCondition.initConditions(" .. serialize(partConditions) .. ")", inventoryId)
  else
@/lua/ge/spawn.lua
  if not options then options = {} end
  queueCallbackInVehicle(veh, "spawn.teleportToLastRoadCallback", "recovery.recoveryPoints", options)
end
@/lua/ge/ge_utils.lua

-- NOTE: please consider using vehicleBridge API instead of queueCallbackInVehicle(), if possible
function queueCallbackInVehicle(veh, geluaFunctionName, vluaCommand, ...)
@/lua/ge/extensions/core/vehicle/partmgmt.lua
    if playerVehicle then
      queueCallbackInVehicle(playerVehicle, "extensions.core_vehicle_partmgmt.savePartConfigFileStage2", "partCondition.getConditions("..serialize(filename)..")")
    end