Events & Exports
This document describes all available events and exports provided by the POSDEVICE system.
Opening the POS Device
Payment Mode
Used when requesting a payment from another player.
TriggerEvent('xdev_posdevice:open_device', 'payment', TARGET_ID)
Export usage:
exports.xdev_posdevice:openDevice('payment', TARGET_ID)
Behavior:
- Opens the POS UI for the operator
- Sends a payment request to the target player
- Locks both players into a synchronized session
History Mode
Used to open the transaction history UI.
TriggerEvent('xdev_posdevice:open_device', 'menu', HISTORY_DATA)
Export usage:
exports.xdev_posdevice:openDevice('menu', HISTORY_DATA)
Behavior:
- Opens the history menu
- Does not involve another player
- Does not create a shared session
Closing the POS Device
TriggerEvent('xdev_posdevice:close_device')
Export usage:
exports.xdev_posdevice:closeDevice()
Behavior:
- Closes the device if active
- Safely clears session data
Client-side Device State
Read the current POS Device state locally.
local info = exports.xdev_posdevice:getInfoDevice()
Example response:
{
device = "payment_menu",
operator = true,
customer = false,
target = 12,
payment_amount = 100
}
Notes
- Client-side only
- Must not be used for security decisions
- Server-side validation is authoritative