QB / ESX
Agency-Vending
Script de máquinas expendedoras con 4 tipos de máquinas, detección automática de props de GTA V, interfaz de teclado numérico, sistema de propiedad de jugadores, gestión de stock y soporte AgencyPay.

01 Instalación
Copiar agency-vending a la carpeta resources
Añadir ensure agency-vending a server.cfg
Ejecutar installation/database.sql en la base de datos
Registrar los objetos según el framework (ESX/QBCore/ox_inventory)
Copiar las imágenes del inventario desde installation/inventory-images/
Configurar config.lua
Dependencias
oxmysql — requeridoESX o QBCore — opcional, admite standaloneox_target / qb-target — opcionalagency-phone — opcional (para AgencyPay)
Archivo SQL
Importa este archivo SQL en tu base de datos antes de iniciar el recurso:
-- =============================================
-- Agency Vending - Database Setup
-- =============================================
-- Execute this SQL in your database
-- The tables are required for the player-owned machines system
--
-- NOTE: The tables are also created automatically on first
-- resource start. This SQL is optional for manual setup.
-- =============================================
CREATE TABLE IF NOT EXISTS `agency_vending_machines` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`owner` VARCHAR(50) NOT NULL,
`type` VARCHAR(50) NOT NULL,
`coords` TEXT NOT NULL,
`heading` FLOAT NOT NULL DEFAULT 0,
`earnings` FLOAT NOT NULL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS `agency_vending_stock` (
`machine_id` INT NOT NULL,
`slot` VARCHAR(10) NOT NULL,
`stock` INT NOT NULL DEFAULT 0,
`price` FLOAT NOT NULL DEFAULT 0,
PRIMARY KEY (`machine_id`, `slot`)
);
CREATE TABLE IF NOT EXISTS `agency_vending_spawned` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`type` VARCHAR(50) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`coords` TEXT NOT NULL,
`heading` FLOAT NOT NULL DEFAULT 0,
`spawned_by` VARCHAR(50) NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);