Everything the fivedash resource exposes to scripts and the console, with Lua examples: the log export, the fivedash:log event and the fivedash command.
This page lists everything the fivedash resource offers your city’s scripts and the server console. The list is short on purpose: one export for logs, an equivalent event and a console command. The rest (whitelist, store) happens on its own, driven by the panel. It’s for script developers.
The log’s Key in FiveDash (Logs → the log → How to send). It’s lowercased. It must be 2 to 32 characters: lowercase letters, numbers, - and _, starting with a letter or number
data
table or string
The log’s content. A string becomes the message
Returns:true when the log went into the send queue; false when it was ignored.
The export only checks the table and queues it: no network, no database. It’s safe to call in a full city, but never inside per-frame loops.
{ id = "1234", name = "John Smith", label = "Victim" }
Out of the city (id is the character ID; passport and passaporte work too)
For a player in the city, the resource fills in: the character ID (the framework’s character ID), the character’s name, the source and the identifiers listed in Identifiers in logs.lua (default license and discord). Without a character picked yet, the FiveM name is used. label is up to 40 characters.
-- List of pairs, in order (recommended)fields = { { "Weapon", "WEAPON_PISTOL" }, { "Distance", 12.5 } }-- With name and value, and inlinefields = { { name = "Weapon", value = "WEAPON_PISTOL", inline = true } }-- Pair with inline as the third valuefields = { { "Weapon", "WEAPON_PISTOL", true } }-- key = value table (order not guaranteed)fields = { Weapon = "WEAPON_PISTOL", Distance = 12.5 }
Values can be text, numbers or booleans (booleans become Yes / No, in the city’s language). Tables become JSON.
exports.fivedash:log("admin", "Scheduled restart in 5 minutes")
With a screenshot:
lua
exports.fivedash:log("reports", { title = "Report with screenshot", player = source, message = "Player reported a map bug", image = "https://cdn.fivex.sh/example-city/screenshots/print-0001.webp",})
Create a function at the top of the file and use it everywhere. That way the script doesn’t break if fivedash is stopped:
lua
local function fivedashLog(data) if GetResourceState("fivedash") ~= "started" then return end exports.fivedash:log("deaths", data)endfivedashLog({ title = "Death recorded", player = source })
The export doesn’t exist on the client, and players can’t send logs. If the action happens on the client, send it to a server event of your script and call the export there. Use the event’s source to know who the player is: never trust an ID or name coming from the client.
The same as the export, for scripts that prefer events. It’s a server-local event: fire it with TriggerEvent from a server script. A client TriggerServerEvent doesn’t reach it.
lua
TriggerEvent("fivedash:log", "deaths", { title = "Death recorded", player = source, fields = { { "Weapon", weapon } },})
Parameters and rules are the same as the export’s. The event returns nothing.
When a purchase arrives (Notify = true in loja.lua) or is announced (Announce = true), the resource fires the framework’s notice client event. If your city swaps the notification system, make sure this event keeps working:
Framework
Client event
Creative Network Enchanted
Notify (title, message, "verde" or "default", 10000)
The export returned true, but the log didn’t show up.
Check that a log with that Key exists in the panel. Logs with an unknown key wait in the queue until the log is created. Run fivedash logs to see the queue and the last error.
Can I call the export in a loop?
Avoid it. One log per event. The resource already batches logs, but per-frame loops fill the queue (up to 20,000 logs, then the oldest are dropped).
Does it work with JavaScript or C# scripts?
Yes. FiveM exports work across languages: in JS, exports.fivedash.log("deaths", { title: "…" }).