RX Scripts Logo
Framework

Functions

Client-side framework functions that work across ESX and QBCore.

The Framework adapter provides unified access to core framework functionality on the client side, automatically detecting whether you're using ESX or QBCore.

Functions

getPlate

Returns the trimmed license plate text of a vehicle.

FM.framework.getPlate(vehicle)
vehicle
number required

Vehicle entity handle

Returns: string - Trimmed vehicle license plate text

Example:

local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = FM.framework.getPlate(vehicle)
print("Vehicle plate:", plate) -- Output: "ABC 123"

notify

Displays a notification to the player.

FM.framework.notify(message, type)
message
string required

Notification message to display

type
'error'|'success'|'info'

Notification type (optional, defaults to 'info')

Example:

FM.framework.notify("Vehicle spawned successfully!", "success")
FM.framework.notify("You don't have permission", "error")
FM.framework.notify("Press E to interact", "info")

hasItem

Checks if the player has a specific item in their inventory.

FM.framework.hasItem(item)
item
string required

Item name to check

Returns: boolean - True if player has the item

Example:

if FM.framework.hasItem("lockpick") then
    print("Player has a lockpick")
else
    FM.framework.notify("You need a lockpick", "error")
end

getItems

Returns all items in the player's inventory.

FM.framework.getItems()

Returns: table<number, Item> - Table of player items indexed by slot

Item Structure:

{
    name = "water",        -- Item name
    label = "Water",       -- Display label
    amount = 5             -- Item count
}

Example:

local items = FM.framework.getItems()
for slot, item in pairs(items) do
    print(string.format("Slot %d: %s x%d", slot, item.label, item.amount))
end

Exports

All framework client functions are available as exports:

exports['fmLib']:framework_getPlate(vehicle)
exports['fmLib']:framework_notify(message, type)
exports['fmLib']:framework_hasItem(item)
exports['fmLib']:framework_getItems()