GE Lua Documentation

Press F to search!

executeCommand

Definition


-- @/lua/ge/extensions/core/windowsConsole.lua:10

local function executeCommand(context, cmd)
  extensions.hook('onConsoleExecuteCommand', context, cmd)
  --log('D', 'winConsole', 'executeCommand: ' .. tostring(context) .. ' - ' .. tostring(cmd))
  if context == 'GE-Lua' then
    -- executed in c++, it does not reach here
  elseif context == 'GE-TorqueScript' then
    TorqueScript.eval(cmd)
  elseif context == 'CEF/UI - JS' then
    be:queueJS(cmd)
  else if nameVidMap[context] then
    local veh = getObjectByID(nameVidMap[context])
    if veh then
      veh:queueLuaCommand(cmd)
    end
  end
  end
end

Callers

@/lua/ge/extensions/core/vehicleTriggers.lua
      end
      return core_input_actions.executeCommand(vdata.inputActions[lnk.inputAction], value, vehicleId)
    elseif lnk.namespace == 'common' then
        end
        return core_input_actions.executeCommand(vdata.inputActions[lnk.inputAction], value, vehicleId)
      end
  -- old: backward compatibility, using event section
    return core_input_actions.executeCommand(lnk.targetEvent, actionValue, vehicleId)
  end
@/lua/ge/extensions/ui/bindingsLegend.lua
  local activeActions = core_input_actions.getActiveActions()
  core_input_actions.executeCommand(activeActions[action], value, be:getPlayerVehicleID(0))
end
@/lua/ge/extensions/core/input/actions.lua
-- returns the executed action count
local function executeCommand(evt, actionValue, vehicleId)
  if evt.ctx == nil or evt.ctx == 'vlua' then