Agency Docs
QBESXStandalone

Agency-Housing Installation

Database driven housing system for FiveM.

v1.1.0Paid5 Pages

01Installation

  1. 1Extract Agency-Housing into your resources folder
  2. 2Install PolyZone if you do not have it yet
  3. 3Add ensure PolyZone and ensure Agency-Housing to server.cfg, after oxmysql
  4. 4Start the server: the database tables are created on the first start
  5. 5Check the console: it names the framework it found or says Running standalone
  6. 6Optional: add_ace group.admin agency.housing allow to grant creator access
  7. 7Standalone: fill in Config.Standalone for money and admins (see the config page)
  8. 8Updating from 1.0: replace the whole folder, carry your values over into the new config.lua and restart the resource once, the database updates itself
  9. 9After an update, run /ahousethumbs once as admin to create pictures for the new furniture

02Dependencies

  • oxmysql (required)
  • PolyZone (required, property borders are built from it)
  • QBCore, QBox or ESX (optional, runs standalone without one)
  • An inventory for storage (optional: ox_inventory, qb-inventory, qs, ps, lj or jpr)
  • illenium-appearance or qb-clothing (optional, otherwise the built-in wardrobe is used)
  • A garage script (optional: Agency-Garage, jg-advancedgarages or qb-garages, found automatically)
  • A phone for the Housing app (optional: Agency Phone, Agency Pad, lb-phone or qs-smartphone-pro)

03SQL File

Optional: the resource creates these tables on its own when it starts. Import this file only if you set up the database by hand:

-- ===================================================== -- Agency Housing: database tables -- ===================================================== -- -- Optional. Agency-Housing creates all of these on start and adds any column an -- older database is missing, so a fresh server needs no import. Run this by -- hand only if your database user is not allowed to create tables. -- -- Safe to run more than once: CREATE TABLE IF NOT EXISTS leaves an existing -- table and its data alone. Works on MariaDB and MySQL 8. -- -- If you changed Config.TableName, change `agency_houses` below to match. -- Houses, their owners, keys and everything placed in them. CREATE TABLE IF NOT EXISTS `agency_houses` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NOT NULL, `shell` VARCHAR(64) NOT NULL, `price` INT NOT NULL DEFAULT 0, `entrance` LONGTEXT NOT NULL, `interior` LONGTEXT DEFAULT NULL, `owner` VARCHAR(80) DEFAULT NULL, `owner_name` VARCHAR(100) DEFAULT NULL, `locked` TINYINT(1) NOT NULL DEFAULT 1, `for_sale` TINYINT(1) NOT NULL DEFAULT 1, `show_blip` TINYINT(1) NOT NULL DEFAULT 1, `keys` LONGTEXT DEFAULT NULL, `created_by` VARCHAR(100) DEFAULT NULL, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, `garage` LONGTEXT DEFAULT NULL, `exit_point` LONGTEXT DEFAULT NULL, `stash_point` LONGTEXT DEFAULT NULL, `wardrobe_point` LONGTEXT DEFAULT NULL, `zone` LONGTEXT DEFAULT NULL, `kind` VARCHAR(16) NOT NULL DEFAULT 'interior', `furniture` LONGTEXT DEFAULT NULL, `upgrades` LONGTEXT DEFAULT NULL, `cameras` LONGTEXT DEFAULT NULL, `doors` LONGTEXT DEFAULT NULL, `blip` LONGTEXT DEFAULT NULL, PRIMARY KEY (`id`), KEY `owner` (`owner`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Who disconnected inside which house, so they are put back on rejoin. CREATE TABLE IF NOT EXISTS `agency_house_inside` ( `identifier` VARCHAR(80) NOT NULL, `house_id` INT NOT NULL, `since` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`identifier`), KEY `house_id` (`house_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Outfits of the built-in wardrobe. CREATE TABLE IF NOT EXISTS `agency_house_outfits` ( `id` INT NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(80) NOT NULL, `name` VARCHAR(40) NOT NULL, `model` INT NOT NULL, `data` LONGTEXT NOT NULL, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Agency Companion app: this server's id and the linked phones. CREATE TABLE IF NOT EXISTS `agency_housing_cmp_meta` ( `k` VARCHAR(64) NOT NULL PRIMARY KEY, `v` TEXT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `agency_housing_cmp_devices` ( `id` INT NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `player_name` VARCHAR(80) DEFAULT NULL, `token_hash` CHAR(64) NOT NULL, `device_name` VARCHAR(64) DEFAULT NULL, `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_seen` TIMESTAMP NULL DEFAULT NULL, `revoked` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `token_hash` (`token_hash`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Still stuck after this page? Our support team takes it from here.