RX Scripts Logo
fmLib

Introduction

Welcome to fmLib - A Multi-Framework Utility Library!

This versatile library is designed to simplify your scripting experience by consolidating various frameworks, resources, and utilities into a cohesive package. Whether you're a seasoned developer or just getting started, fmLib aims to provide a convenient wrapper to streamline the integration of commonly used tools and functionalities in your scripts.

Overview

fmLib is a continuously evolving project, offering a collection of adapters and modules designed to enhance scripting in FiveM. The library provides unified APIs that work across ESX, QBCore, and QBox frameworks, along with support for 40+ popular resources.

Key Features

🔄 Multi-Framework Support

Write your scripts once, and they work on ESX, QBCore, and QBox without any code changes. fmLib automatically detects your framework and provides a consistent API.

🎯 Smart Adapters

The new v2 adapter system automatically detects and integrates with 40+ popular resources:

  • 10+ Inventory Systems - ox_inventory, qb-inventory, qs-inventory, and more
  • 13+ Vehicle Key Systems - Unified key management across all systems
  • 17+ Fuel Systems - Consistent fuel handling with automatic fallback
  • Multiple Garage Systems - Unified garage operations
  • TextUI Libraries - ox_lib, jg-textui, okokTextUI support
  • Appearance Systems - Character customization across systems
  • Banking/Accounts - Society account management

âš¡ Powerful Player Object

Server-side player object with 20+ methods for common operations:

local player = FM.player.get(src)
player.addMoney(500, 'bank')
player.addItem("water", 5)
player.notify("Transaction complete!", "success")

📞 Built-in RPC System

Promise-based callback system for clean client-server communication:

-- Server
FM.callback.register('getBalance', function(src)
    local player = FM.player.get(src)
    return player.getMoney('bank')
end)

-- Client
local balance = FM.callback.sync('getBalance')
print("Balance:", balance)

🔌 Zero Configuration

Just install fmLib, and it automatically detects all compatible resources on your server. No manual configuration needed!

What's New in v2

The v2 release brings a completely redesigned architecture:

  • Adapter System - Replaces the old wrapper system with a more flexible adapter pattern
  • Lazy Loading - Resources are only loaded when needed, improving performance
  • Better Detection - Automatic resource detection without manual configuration
  • Consistent API - All adapters follow the same patterns and structure
  • Full Type Hints - Complete LuaLS annotations for better IDE support
Backwards Compatibility: v1 wrapper functions still work but will show deprecation warnings. We recommend migrating to the new adapter API for better performance and features.

Quick Start

-- In your resource's fxmanifest.lua, make sure fmLib is a dependency
dependency 'fmLib'

-- In your client/server lua files
FM = exports.fmLib:new()

-- Client-side
if FM.player.isLoggedIn() then
    local job = FM.player.getJob()
    FM.framework.notify(string.format("Welcome %s!", job.label), "success")
end

-- Server-side
RegisterNetEvent('shop:purchase', function(item, amount)
    local src = source
    local player = FM.player.get(src)
    if not player then return end

    if player.getMoney('money') >= 100 then
        player.removeMoney(100, 'money')
        player.addItem(item, amount)
        player.notify("Purchase successful!", "success")
    else
        player.notify("Insufficient funds", "error")
    end
end)

Documentation Structure

Installation

Step-by-step guide to install and configure fmLib on your server.

Adapters

Unified APIs that work across multiple resources:

Client Adapters

  • Framework - Core framework functions (notifications, items, etc.)
  • Player - Client player data access
  • Inventory - Inventory operations (10+ systems)
  • TextUI - Text display systems
  • Vehicle Keys - Key management (13+ systems)
  • Fuel - Fuel systems (17+ systems)
  • Garage - Garage integrations
  • Appearance - Character customization

Server Adapters

  • Framework - Server framework functions
  • Player - Powerful player object with 20+ methods
  • Inventory - Server inventory operations
  • Account - Society/shared account management

Modules

Standalone utilities that enhance your scripts:

  • Callback - Promise-based client-server RPC system

Supported Frameworks

  • ESX (es_extended)
  • QBCore (qb-core)
  • QBox (qbx_core) - Works through QBox's backwards compatibility with qb-core

Supported Resources

Inventories

  • ox_inventory
  • qb-inventory
  • qs-inventory
  • ps-inventory
  • codem-inventory
  • jpr-inventory
  • tgiann-inventory
  • chezza inventory
  • core_inventory
  • origen_inventory

Vehicle Keys

  • qb-vehiclekeys
  • qs-vehiclekeys
  • Renewed-Vehiclekeys
  • wasabi_carlock
  • tgiann-hotwire
  • mm_carkeys
  • MrNewbVehicleKeys
  • is_vehiclekeys
  • fast-vehiclekeys
  • filo_vehiclekey
  • qbx_vehiclekeys

Fuel Systems

  • ox_fuel
  • LegacyFuel
  • cdn-fuel
  • renewed-fuel
  • qb-fuel
  • lc_fuel
  • ps-fuel
  • rcore_fuel
  • qs-fuelstations
  • ND_Fuel
  • BigDaddy-Fuel
  • gks-fuel
  • RiP-Fuel
  • myFuel
  • lj-fuel
  • melons_fuel
  • hrs_fuel
  • Native (automatic fallback)

Garages

  • cd_garage
  • okokGarage
  • jg-advancedgarages
  • mGarage (codem)
  • RxGarages

TextUI

  • ox_lib
  • jg-textui
  • okokTextUI

Appearance/Clothing

  • fivem-appearance
  • illenium-appearance
  • qb-clothing
  • esx_skin
  • crm-appearance
  • 17mov_CharacterSystem

Accounts/Banking

  • esx_addonaccount
  • qb-management
  • RxBanking (optional integration)

Community & Support

  • GitHub: github.com/meesvrh/fmLib
  • Documentation: You're reading it! 📚
  • Issues: Report bugs or request features on GitHub

License

fmLib is open-source and free to use in your FiveM projects.


Ready to get started? Head over to the Installation guide!