Agency Docs
QBESXStandalone

Agency-Lifeinvader V3 Exports & API

The ad agency of the city for FiveM on QBCore, Qbox, ESX or fully standalone.

v3.2.0Paid5 Pages

01Client Exports

ExportDescription
OpenApp(tab)Opens the app on the page you name: 'feed', 'create', 'mine', 'drafts' or 'settings'. Without a page it opens the page used last, or the live feed.
OpenFeed()Opens the app on the live feed.
CloseApp()Closes the app.
IsOpen()True while the app is open on this client.

02Server Exports

ExportDescription
PostAd(text, opts)Posts an ad of the server itself: free, never reviewed and first in the queue. opts: author, category, instant (runs right away), reps, interval, duration and boosted. Returns the ad id, or nil and an error code.
GetFeed(limit)The live feed as the app shows it, newest first: id, text, category, boosted, author (nil for anonymous ads), sentAt, created, sent and live.
GetAd(id)One ad in the same form as the feed, or nil.
IsAdmin(source)True when the player is a Lifeinvader admin by ACE, group or identifier.

03Events

NameSideDescription
agency-lifeinvader:adShownClientLocal event on every client when an ad appears on the screen, with id, text, category, catLabel, icon, author (nil when anonymous), boosted, duration and system (true for official announcements).
agency-lifeinvader:adBroadcastServerLocal event on the server each time an ad runs, with the ad in the form of the feed. Good for logs or a Discord webhook.
agency_lifeinvader:openMenuClientKept from V3: opens the app on New ad, so scripts that opened the old menu keep working.
agency_lifeinvader:openRecentMenuClientKept from V3: opens the app on the live feed.

+Good to know

Other scripts can post ads, read the feed, open the app and react to every ad through the exports and events of Agency-LifeinvaderV3.

Post from Your Scripts
PostAd puts an ad of the server itself on every screen: free, never reviewed and first in the queue, with its own author and category.
Read the Feed
GetFeed and GetAd return ads in the form of the live feed, for websites, newspapers or phone apps.
React to Ads
agency-lifeinvader:adShown fires on each client when an ad appears, agency-lifeinvader:adBroadcast on the server each time an ad runs. The V3 events that opened the menus still work.

?Frequently asked questions

Does PostAd cost money or need a review?

No. Ads of the server are free, never reviewed and go first in the queue. With instant = true the ad runs right away.

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