Agency-Lifeinvader V3 Конфигурация
Городское рекламное агентство для FiveM на QBCore, Qbox, ESX или полностью standalone.

01Конфигурация
Быстрая установка · config.lua · Agency-Lifeinvader V3
--[[
╔══════════════════════════════════════════════════════════════════════╗
║ AGENCY LIFEINVADER - CONFIGURATION ║
║ (c) Agency Scripts ║
╚══════════════════════════════════════════════════════════════════════╝
The ad agency of the city. Players write ads that run across the screen
of every player: categories, boosts, scheduling, drafts, a live feed,
review by admins or the staff of the agency job, and an Auto-Check for
spam. Finds QBCore, Qbox or ESX by itself and runs fully standalone
without any of them, with or without a database.
CONTENTS
1. Agency Companion The free app for your players, accent colour
2. Core Framework, language, debug, storage
3. Integrations Agency-Notify, Agency-Progressbar
4. Look Name, logos, colour
5. Keys and commands
6. Ads Length, runs, timing, boosts
7. Prices and payment Prices, bank or cash, Agency Pay
8. Categories
9. Review Review and the spam Auto-Check
10. Limits per player
11. Ad banners Defaults for every player
12. The ad agency (job) Staff panel, company account, commission
13. Agency Phone and Pad The Lifeinvader app on the devices
14. Admins
15. History
16. Standalone Money and names without a framework
17. Your own wording
Admins change prices, review and the categories in the menu (/aladmin,
tab Settings). Those values are saved for the whole server and win over
this file until "Reset to config.lua" is pressed.
Discord: https://discord.gg/RTax3aBMUs · Shop: https://shop.agencyg.de
]]
Config = {}
--==============================================================================
-- 1 · AGENCY COMPANION
--==============================================================================
-- Agency-Companion (free): https://shop.agencyg.de/en/product/agency-companion
-- One resource for every Agency script: your players link them with the free
-- Agency Companion app (iPhone, Android, web), and your admins pick one accent
-- colour for all Agency scripts in game (/app, admin page). Drop it into your
-- resources and Lifeinvader follows it by itself. Nothing else to set up.
Config.Companion = {
Enabled = true, -- follow Agency-Companion (accent colour)
}
-- ── Accent colour ────────────────────────────────────────────────────────────
-- false = the colour from Agency-Companion, gold without it
-- { r,g,b } = a fixed colour for this script only, e.g. { 0, 190, 255 }
Config.AccentColor = false
--==============================================================================
-- 2 · CORE
--==============================================================================
-- ── Framework ────────────────────────────────────────────────────────────────
Config.Framework = 'auto' -- 'auto' | 'qbcore' (also Qbox) | 'esx' | 'standalone'
-- ── Language ─────────────────────────────────────────────────────────────────
-- en bg cs da de el es fi fr hr hu it ja ko nb nl pl pt ro ru sk sv tr uk zh
-- (also ar and hi; 'no' still works and means nb)
Config.Locale = 'en'
-- ── Debug ────────────────────────────────────────────────────────────────────
-- Every request and every ad of the queue in the server console.
-- Admins can switch it in the menu as well.
Config.Debug = false
-- ── Storage ──────────────────────────────────────────────────────────────────
-- Where ads, drafts and player settings are saved. 'auto' uses oxmysql when
-- it runs (the V3 tables, created and upgraded by themselves) and otherwise
-- the server's own key value store, so a server without a database works too.
Config.Storage = 'auto' -- 'auto' | 'mysql' | 'kvp'
--==============================================================================
-- 3 · INTEGRATIONS
--==============================================================================
-- ── Notifications ────────────────────────────────────────────────────────────
-- Agency-Notify (free): https://shop.agencyg.de/en/product/notify
-- 'auto' = Agency-Notify when it runs, then a notification on Agency Phone,
-- then your framework, then the GTA feed. While the app is open, messages
-- appear in it.
Config.Notify = 'auto' -- 'auto' | 'agency' | 'framework' | 'gta'
-- ── Progress bar ─────────────────────────────────────────────────────────────
-- Agency-Progressbar (free): https://shop.agencyg.de/en/product/progressbar
-- Lifeinvader has no timed actions (posting an ad is instant), so it needs no
-- progress bar. Nothing to set up here.
--==============================================================================
-- 4 · LOOK
--==============================================================================
-- Everything fits the screen resolution by itself.
Config.UI = {
brand = 'LIFEINVADER', -- name in the app and on every ad
subtitle = '', -- line under the name, '' = "Ad agency" in the server language
-- Logo on every ad banner: a file in html/, a nui:// or https:// link, or ''
-- for a megaphone icon. Best as a square PNG with a transparent background
-- (logo.png is the gold Lifeinvader logo).
logo = 'logo.png',
-- Logo at the top left of the menus. 'img/logo.png' is the gold Agency
-- logo; put your own file in html/ or a link here to show your server.
menuLogo = 'img/logo.png',
tintLogo = false, -- true draws the logo in the accent colour (good for a white logo)
-- Older setting, still read: any colour other than '#E2B649' counts like
-- Config.AccentColor (a fixed colour for this script). Prefer section 1.
accent = '#E2B649',
scale = 1.0, -- not used any more (automatic), kept for older configs
}
--==============================================================================
-- 5 · KEYS AND COMMANDS
--==============================================================================
-- Players can change both keys in the GTA settings (Key Bindings > FiveM).
-- F6 is free in all Agency scripts (Vehiclekeys F5, Housing F7, Admin F10).
Config.Keys = {
open = 'F6', -- opens the app
feed = '', -- opens the live feed directly, '' = no key (players can set one)
}
Config.Commands = {
open = 'alad', -- the app
feed = 'alfeed', -- the live feed
test = 'altest', -- shows a sample ad to yourself, to try the banner position
admin = 'aladmin', -- admin panel
agency = 'alagency', -- staff panel of the ad agency job
}
--==============================================================================
-- 6 · ADS
--==============================================================================
Config.Ads = {
minLength = 10, -- characters an ad needs at least
maxLength = 300, -- characters at most
maxLines = 6, -- lines one ad may have
maxRepetitions = 5, -- how often one ad may run (categories can lower it)
interval = { min = 30, max = 300, default = 60 }, -- seconds between two runs of the same ad
duration = { min = 5, max = 60, default = 8 }, -- seconds an ad stays on screen
delays = { 0, 10, 30, 60, 300 }, -- start delays the form offers, in seconds
anonymous = true, -- players may post without their name
schedule = { enabled = true, maxHoursAhead = 24 }, -- post an ad for a later time
-- Seconds between two ads across the whole city. Ads wait in a queue and
-- never flood the screen, however many are booked.
gap = 15,
maxOnScreen = 3, -- banners on a player's screen at the same time
}
Config.Boost = {
enabled = true,
multiplier = 2.0, -- a boosted ad costs this many times the price
priority = 8, -- and jumps this far ahead in the queue
}
--==============================================================================
-- 7 · PRICES AND PAYMENT
--==============================================================================
-- Price of one run = (base + perSecond x seconds on screen) x category factor,
-- times 2 with a boost. The total is that times the number of runs.
Config.Pricing = {
base = 5000,
perSecond = 500,
}
Config.Money = {
-- What players pay with. The first one is picked in the form, the player
-- can switch when there are more. 'bank' | 'cash'
methods = { 'bank', 'cash' },
currency = '$',
-- Rejected, withdrawn and stopped ads pay back what has not run yet.
-- A player who is offline gets it the next time he joins.
refunds = true,
-- Agency Pay from Agency Phone: the phone opens, the player confirms the
-- payment there, the money comes from his bank account. Offered as soon
-- as the phone runs; enabled = false hides it.
agencyPay = { enabled = true, resource = 'agency-phone', timeout = 90 },
}
--==============================================================================
-- 8 · CATEGORIES
--==============================================================================
-- id stays the same once ads use it
-- label used when the language files have no text for this id
-- icon briefcase car home wrench party pin food shop music heart star megaphone tag bolt
-- price factor on the price (0.9 = 10 % cheaper)
-- priority places ahead in the queue
-- review ads of this category always wait for a staff member
-- maxRepetitions runs at most (below Config.Ads.maxRepetitions)
-- minInterval seconds at least between two runs
Config.Categories = {
{ id = 'jobs', label = 'Jobs', icon = 'briefcase', price = 0.9, priority = 2, review = false, maxRepetitions = 4, minInterval = 30 },
{ id = 'vehicles', label = 'Vehicles', icon = 'car', price = 1.15, priority = 1, review = false, maxRepetitions = 5, minInterval = 45 },
{ id = 'realestate', label = 'Real Estate', icon = 'home', price = 1.25, priority = 1, review = true, maxRepetitions = 4, minInterval = 60 },
{ id = 'services', label = 'Services', icon = 'wrench', price = 1.0, priority = 2, review = false, maxRepetitions = 5, minInterval = 30 },
{ id = 'events', label = 'Events', icon = 'party', price = 1.1, priority = 3, review = false, maxRepetitions = 5, minInterval = 30 },
{ id = 'other', label = 'Other', icon = 'pin', price = 1.0, priority = 0, review = false, maxRepetitions = 3, minInterval = 45 },
}
--==============================================================================
-- 9 · REVIEW
--==============================================================================
Config.Review = {
-- Every ad waits for an admin or a staff member of the agency before it
-- runs. Admins switch this in the menu.
required = false,
-- Auto-Check: simple rules on your own server, no outside service. It
-- looks for shouting, links, phone number walls, repeated texts and spam
-- and holds such ads back for review. Admins see why.
autoCheck = {
enabled = true,
holdOnFlag = true, -- flagged ads wait for review
threshold = 4, -- penalty points that count as flagged
duplicateMinutes = 30, -- the same text again within this time is a repeat
duplicateLimit = 1, -- repeats allowed before it counts
links = { 'http://', 'https://', 'www.', 'discord.gg', 'bit.ly' },
suspicious = { '@everyone', 'free money', 'hack', 'exploit', 'cheap cash', 'real money' },
blocked = {}, -- ads with one of these words are refused outright
points = {
duplicate_message = 3, aggressive_frequency = 2, excessive_caps = 1, excessive_symbols = 1,
external_link = 2, contact_heavy = 1, suspicious_term = 2, long_copy = 1,
},
},
}
--==============================================================================
-- 10 · LIMITS PER PLAYER
--==============================================================================
Config.Limits = {
cooldown = 45, -- seconds between two ads of one player
maxWaiting = 3, -- ads waiting for review
maxRunning = 4, -- ads running or scheduled
maxDrafts = 12,
staffBypass = true, -- admins are not limited
}
--==============================================================================
-- 11 · AD BANNERS
--==============================================================================
-- Defaults for every player. Players change position, sound and the
-- categories they want to see in the app (tab Settings). Banners fit the
-- screen resolution by themselves.
Config.Banner = {
position = 'middle-left', -- 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right'
scale = 1.0, -- not used any more (automatic), kept for older configs
sound = true,
width = 380, -- pixels
showAuthor = true, -- false hides who posted, on every ad
sounds = {
ad = { name = 'TEXT_ARRIVE_TONE', set = 'HUD_AWARDS' },
publish = { name = 'PURCHASE', set = 'HUD_LIQUOR_STORE_SOUNDSET' },
},
}
--==============================================================================
-- 12 · THE AD AGENCY (JOB)
--==============================================================================
-- Staff of the agency get a panel (/alagency): the company account, what
-- the ads earn, and the review of waiting ads. The company earns a share of
-- every ad as it runs; the staff member who approved an ad gets a commission
-- on every run of it.
Config.Agency = {
enabled = true,
job = 'lifeinvader', -- job of the staff (QBCore, Qbox, ESX)
ace = 'agency.lifeinvader.staff', -- without a framework: players with this ACE are staff
grade = 0, -- lowest job grade that opens the panel
bossGrade = 3, -- grade that may take money out of the company account
review = true, -- staff may approve and reject waiting ads
revenue = 100, -- % of every ad's price that goes to the company account
commission = 10, -- % for the staff member who approved the ad, taken from the company share
account = 'lifeinvader', -- name of the company (society) account
-- 'auto' finds Renewed-Banking, qb-banking, qb-management, okokBanking and
-- esx_addonaccount (society_<account>). 'internal' keeps the money in
-- this script; bosses pay it out in the panel.
bank = 'auto',
payTo = 'bank', -- commission and payouts go to 'bank' or 'cash'
}
--==============================================================================
-- 13 · AGENCY PHONE AND AGENCY PAD
--==============================================================================
-- When Agency Phone or Agency Pad (27.0.2 or newer) runs on the server,
-- Lifeinvader puts its own app on them by itself: the live feed, new ads,
-- my ads and drafts, right on the device. Nothing to set up.
Config.Devices = {
phone = true, -- app on Agency Phone
pad = true, -- app on Agency Pad
label = 'Lifeinvader',
installed = true, -- already on the home screen, not only in the App Store
-- Messages about your ads (approved, rejected, refunds) come as app
-- notifications on the phone while its app is there.
notifications = true,
}
--==============================================================================
-- 14 · ADMINS
--==============================================================================
-- Admins: players with the ACE below, group.admin or group.superadmin, one of
-- the framework groups, or one of the identifiers.
Config.Admin = {
ace = 'agency.lifeinvader.admin',
groups = { 'admin', 'god', 'superadmin' },
identifiers = {
-- 'license:xxxxxxxx', 'discord:xxxxxxxx', 'steam:xxxxxxxx',
},
}
--==============================================================================
-- 15 · HISTORY
--==============================================================================
Config.History = {
keepDays = 30, -- finished ads and admin log entries older than this are removed
feed = 30, -- ads in the live feed
mine = 20, -- a player's own ads in "My ads"
}
--==============================================================================
-- 16 · STANDALONE
--==============================================================================
-- Without QBCore, Qbox or ESX:
-- money: 'auto' uses Agency-Banking when it runs, otherwise ads are free.
-- 'hooks' uses the functions below, 'free' never charges.
-- staff: players with Config.Agency.ace, admins by Config.Admin.
Config.Standalone = {
money = 'auto', -- 'auto' | 'banking' | 'hooks' | 'free'
-- getMoney = function(src, account) return 0 end, -- account: 'cash' | 'bank'
-- removeMoney = function(src, account, amount) return true end,
-- addMoney = function(src, account, amount) return true end,
-- getName = function(src) return GetPlayerName(src) end, -- the character name on ads
-- addCompanyMoney = function(account, amount) return true end, -- company account of the agency
}
--==============================================================================
-- 17 · YOUR OWN WORDING
--==============================================================================
-- Any text of the language files can be replaced here and survives updates:
-- Config.Text = { ui_publish = 'Send it!', ad_published = 'Your ad is live.' }
Config.Text = {}
02SQL файл
Необязательно: ресурс сам создаёт эти таблицы при запуске. Импортируйте файл, только если настраиваете базу данных вручную:
-- =============================================================================
-- Agency Lifeinvader 3.2: database tables (OPTIONAL)
-- -----------------------------------------------------------------------------
-- You do not need to run this file. With oxmysql the script creates these
-- tables on the first start and upgrades the tables of Lifeinvader V2 and V3
-- in place. Run it only if your server creates tables by hand.
-- =============================================================================
CREATE TABLE IF NOT EXISTS `lifeinvader_ads` (
`id` INT NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(100) NOT NULL,
`author_name` VARCHAR(100) DEFAULT NULL,
`message` TEXT NOT NULL,
`category` VARCHAR(50) DEFAULT 'other',
`anonymous` TINYINT DEFAULT 0,
`boosted` TINYINT DEFAULT 0,
`repetitions_total` INT DEFAULT 1,
`repetitions_left` INT DEFAULT 1,
`interval_seconds` INT DEFAULT 60,
`display_duration` INT DEFAULT 8,
`status` VARCHAR(16) NULL DEFAULT 'active',
`approved` TINYINT DEFAULT 1,
`approved_by` VARCHAR(100) DEFAULT NULL,
`rejected_reason` TEXT DEFAULT NULL,
`next_send_time` DATETIME DEFAULT NULL,
`scheduled_for` DATETIME DEFAULT NULL,
`review_requested_at` DATETIME DEFAULT NULL,
`reviewed_at` DATETIME DEFAULT NULL,
`review_decision` VARCHAR(32) DEFAULT NULL,
`queue_priority` INT DEFAULT 0,
`ai_score` INT DEFAULT 0,
`ai_flags` LONGTEXT DEFAULT NULL,
`admin_notes` LONGTEXT DEFAULT NULL,
`price_paid` INT DEFAULT NULL,
`paid_with` VARCHAR(16) DEFAULT NULL,
`refunded` INT DEFAULT 0,
`reviewer` VARCHAR(100) DEFAULT NULL,
`sent_count` INT DEFAULT 0,
`last_sent_at` DATETIME DEFAULT NULL,
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_identifier` (`identifier`),
KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `lifeinvader_ad_drafts` (
`id` INT NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(100) NOT NULL,
`title` VARCHAR(120) DEFAULT NULL,
`message` TEXT NOT NULL,
`category` VARCHAR(50) DEFAULT 'other',
`anonymous` TINYINT DEFAULT 0,
`boosted` TINYINT DEFAULT 0,
`repetitions_total` INT DEFAULT 1,
`interval_seconds` INT DEFAULT 60,
`display_duration` INT DEFAULT 8,
`delay` INT DEFAULT 0,
`scheduled_for` DATETIME DEFAULT NULL,
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `lifeinvader_player_settings` (
`id` INT NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(100) NOT NULL,
`notification_position` VARCHAR(20) DEFAULT 'middle-left',
`notification_enabled` TINYINT DEFAULT 1,
`notification_scale` FLOAT DEFAULT 1.0,
`ui_transparency` FLOAT DEFAULT 0.55,
`accent_color` VARCHAR(20) DEFAULT NULL,
`sound_enabled` TINYINT DEFAULT 1,
`admin_panel_scale` FLOAT DEFAULT 1.0,
`muted_categories` VARCHAR(255) DEFAULT NULL,
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `lifeinvader_admin_logs` (
`id` INT NOT NULL AUTO_INCREMENT,
`admin_identifier` VARCHAR(100) DEFAULT NULL,
`admin_name` VARCHAR(100) DEFAULT NULL,
`action` VARCHAR(64) NOT NULL,
`ad_id` INT DEFAULT NULL,
`metadata` LONGTEXT DEFAULT NULL,
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_action` (`action`),
KEY `idx_ad_id` (`ad_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+Полезно знать
В config.lua есть 16 разделов с комментариями, от выбора фреймворка до собственных формулировок. Цены, правила проверки, продвижение и категории также можно менять в панели администратора в игре, для всего сервера.
- Общие настройки и внешний вид
- Config.Framework, Config.Locale, Config.Debug, Config.Storage и Config.Notify задают фреймворк, язык, режим отладки, место хранения данных и способ отображения сообщений. Config.UI задаёт название бренда, подзаголовок, логотип, акцентный цвет и размер приложения.
- Клавиши и команды
- Config.Keys задаёт клавишу F6 и необязательную клавишу для прямой трансляции, Config.Commands задаёт названия команд /alad, /alfeed, /altest, /aladmin и /alagency.
- Объявления и продвижение
- Config.Ads задаёт длительность, количество строк, показы, интервал, время показа на экране, задержки перед началом, анонимные объявления, расписание, интервал между двумя объявлениями и количество баннеров, отображаемых на экране одновременно. Config.Boost задаёт множитель цены и то, насколько выше продвигаемое объявление поднимается в очереди.
- Цены и оплата
- Config.Pricing задаёт базовую цену и цену за секунду показа на экране. Config.Money задаёт банковский счёт и наличные, валюту, возвраты и Agency Pay.
- Категории
- Config.Categories содержит шесть категорий с иконкой, множителем цены, приоритетом, проверкой, количеством показов и интервалом.
- Проверка и Auto-Check
- Config.Review определяет, должно ли каждое объявление ожидать проверки и как Auto-Check оценивает ссылки, заглавные буквы, символы, цифры, повторы, а также подозрительные и запрещённые слова на основе установленных правил.
- Ограничения
- Config.Limits задаёт время ожидания между двумя объявлениями одного игрока, количество ожидающих и активных объявлений на игрока, количество черновиков и то, распространяются ли ограничения на администраторов.
- Баннеры, работа и устройства
- Config.Banner задаёт положение, размер, звук и ширину баннеров по умолчанию. Config.Agency задаёт работу, ранги, долю выручки, комиссию и счёт компании, а Config.Devices определяет приложение в Agency Phone и Agency Pad.
- Администраторы, история и автономный режим
- Config.Admin задаёт ACE, группы и идентификаторы администраторов, Config.History определяет, как долго хранятся объявления, Config.Standalone задаёт деньги без фреймворка, а Config.Text позволяет заменить любой текст, чтобы выбранные формулировки сохранялись после обновлений.
?Частые вопросы
На что влияют настройки в панели администратора?
Правила модерации, Auto-Check, анонимные объявления, режим отладки, цены, интервал между объявлениями, продвижение и все категории. Настройки сохраняются для всего сервера и имеют приоритет над config.lua, пока не будет нажата кнопка Reset to config.lua или в консоли не будет выполнена команда lifeinvader reset.
Как изменить текст?
Добавьте его в Config.Text с ключом из языковых файлов, например Config.Text = { ui_publish = 'Отправить!' }. Изменение сохранится после обновлений.