01安装
- 1将 agency-vending 复制到 resources 文件夹
- 2在 server.cfg 中加入 ensure agency-vending
- 3在数据库中执行 installation/database.sql
- 4按框架注册物品(ESX/QBCore/ox_inventory)
- 5从 installation/inventory-images/ 复制背包图片
- 6配置 config.lua
02依赖项
oxmysql(必需)ESX 或 QBCore(可选,支持独立运行)ox_target / qb-target(可选)agency-phone(可选,用于 AgencyPay)
03SQL 文件
在启动资源之前,将此SQL文件导入数据库:
-- =============================================
-- 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
);
