[QBOX/QB-Core] ADS System

:sparkles: Headline Features

  • :clipboard: Predefined Ads - Police, EMS, Mechanic, Taxi, Realtor, Lawyer, Anonymous, General - fully editable in shared/adtypes.lua.

  • :pencil: Custom Ads Tab - Players craft banners with title, message, category, logo URL, background URL, text colour, sound. Live preview while typing.

  • :three_o_clock: Personal History - Last 50 ads stored per player. One-click Resend pre-fills the composer.

  • :shield: Admin Panel - Recent-ads audit, ban / unban / edit ban per CitizenID, ad scheduling, kill running ad, disable system, clear stuck broadcast lock.

  • :money_bag: Per-Ad Billing - Each predefined ad has its own price. Custom ads charged a flat fee from bank. Cash-first / bank-first toggle.

  • :stopwatch: Server-Side Cooldowns - Per-player throttle, configurable. Cooldown bar shown in UI.

  • :prohibited: Word Filter - Block or censor profanity (configurable list, action block or censor).

  • :satellite_antenna: Discord Logging - Rich embed sent on every ad. Webhook URL configurable.

  • :file_cabinet: oxmysql History - Auto-creates ads_history table. Per-player row limit configurable.

  • :speaker_high_volume: Sound System - OGG via NUI (default) or GTA frontend beep fallback. Per-ad-type sound override.

  • :round_pushpin: 6 Banner Positions - top-center, top-left, top-right, bottom-center, bottom-left, bottom-right.

  • :artist_palette: Banner Branding - Per-type logo, background, text colour. Player-defined colours on custom ads.

  • :compass: Job Gating - allowedJobs = { 'police', 'lspd', 'sheriff' }. Empty = everyone. adminOnly = true for staff-only types.

  • :gear: Framework Detection - Config.Framework = 'auto' finds QB-Core or qbx_core; force either if you prefer.


:framed_picture: Screenshots

Predefined Ads

Searchable list, per-type cost, last-ad recall, sound picker, message + display-duration controls, job-gating notice.

Composer Predefined

Custom Ads

Live preview banner, category grid, logo / background / colour pickers, character counters, cost notice.

Composer Custom

History

Personal feed of last 50 ads with one-click Resend.

Composer History

Admin Panel - Ban Management

CitizenID ban form with reason + duration, live list of active bans with edit / unban actions. Other sub-tabs: recent-ads audit, ad scheduling, lock controls.

Admin Panel

Live Banner - Police Broadcast

Job-gated, free, custom siren sound, top-center, blue accent.

Police Banner

Live Banner - Mechanic with Custom Background

Per-type background image, brand-yellow text, full scrolling message body.

Mechanic Banner


:clipboard: Requirements

Dependency Version
QB-Core or qbx_core Latest
oxmysql Latest
ox_lib Latest

:high_voltage: Install - Under 60 Seconds

  1. Drop ads-system into resources/.

  2. ensure ads-system in server.cfg after QB-Core / oxmysql / ox_lib.

  3. SQL table auto-creates on first start.

  4. Edit shared/config.lua - webhook, currency, cooldown.

  5. Edit shared/adtypes.lua - add your serverโ€™s ad types.

Players type /ads. Done.


:hammer_and_wrench: Configuration

Config.Framework = 'auto' -- auto | qbcore | qbox
Config.Command = 'ads' -- /ads
Config.PlayerCooldown = 120 -- seconds between ads
Config.DisplayTime = 11 -- banner duration (seconds)
Config.BannerPosition = 'top-center' -- 6 positions supported
Config.CurrencySymbol = 'R'

Config.Billing.enabled = true
Config.Billing.cashFirst = true

Config.WordFilter.enabled = true
Config.WordFilter.action = 'block' -- block | censor

Config.Discord.enabled = true
Config.Discord.webhook = 'https://discord.com/api/webhooks/...'

Config.SaveAds.enabled = true
Config.SaveAds.historyLimit = 50

Config.CustomAds.enabled = true
Config.CustomAds.cost = 500
Config.CustomAds.titleMaxLen = 60
Config.CustomAds.messageMaxLen = 400

Ad type definition (shared/adtypes.lua)

{
id = 'police',
label = 'POLICE ๐Ÿš”',
icon = '๐Ÿ‘ฎ',
subject = 'LSPD Announcement',
description = 'Official law enforcement broadcast',
cost = 0,
allowedJobs = { 'police', 'lspd', 'sheriff' },
adminOnly = false,
textColour = '#93c5fd',
soundId = 'police',
}

Per-type logoUrl, bgUrl, textColour, soundId all optional and override player defaults.


:bullseye: Why This Script?

  • No bloat - Single command, no extra menus to learn.

  • Server-authoritative - Cooldown, billing, job-gating, word filter all enforced server-side.

  • Audit-ready - Every ad in MySQL + Discord. Bans tracked per CitizenID with reason + duration + admin name.

  • Drop-in - QB-Core and QBox auto-detected. No fork needed.

  • Modern UI - CEF-friendly CSS (no backdrop-filter), dark glass aesthetic, scroll-on-overflow message body.

Documentation | Tebex - $5.00 | Discord

| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | ยฑ 1000 |
| Requirements | ox_lib, oxmysql |
| Support | Yes |

1 Like

Nice quality-of-life feature for staff teams

1 Like

good quality of life features , been looking for something like this for a while.