TXOS - FiveM Scripts Documentation
STOREDISCORD
  • TXOS Documentation
  • DEPENDENCY
    • TXOS Lib
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Framework customization
  • Resources
    • TXOS Armory
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Badge
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Jewel
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Trucking
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Esc
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
Powered by GitBook
On this page
  1. Resources
  2. TXOS Esc

Open methods

We have some open methods on the client and server of esc. These allow you to change keybinds or do checks for when you are allowed to open the esc menu.

OpenMethods = {}

-- Register key mappings
RegisterKeyMapping('+escape', 'Open Pause Menu', 'keyboard', 'escape')
RegisterKeyMapping('+openmap', 'Open Map Menu', 'keyboard', 'm')

function OpenMethods.canOpenEscapeMenu() -- Define if the player can open the escape menu
    --[[if exports['ox_inventory']:IsOpen() or exports["lb-phone"]:IsOpen() or exports['qs-inventory']:inInventory() then
        return false
    end]]

    return true
end
OpenMethods = {}

function OpenMethods.disconnectPlayer(source) -- Define the disconnect message or if you want to add logs when they quit through the escape menu
    DropPlayer(source, 'Disconnected')
end

PreviousConfigurationNextExports / Events

Last updated 5 months ago