Skip to content

Frontier Wire — Editable Files (Client) ​

File: frontier_mailbox/bridge/hooks/client.lua is not escrowed: write your own code inside the functions already in that file (each exists once). Back it up before installing an update, because an update replaces it. Every function is optional. They run on the player's game client and must not block: no long loops and no waiting inside them.

Other resources can listen to the same moments as client events instead.


Hooks.opened(screen) ​

A postal screen opened. screen: 'player' (post office counter), 'compose' (telegram paper), 'bird' (carrier bird sheet), 'admin' (admin desk) or 'ace' (the "no permission" card).

Example: hide the minimap while a postal screen is open.

lua
function Hooks.opened(screen)
    DisplayRadar(false)
end

Hooks.closed() ​

The postal screen closed. Example: show the minimap again.

lua
function Hooks.closed()
    DisplayRadar(true)
end

Hooks.unread(count) ​

The number of unread telegrams of this character changed. Example: a VORP notice when new mail is waiting.

lua
local lastUnread = 0

function Hooks.unread(count)
    if count > lastUnread then
        -- vorp:TipRight is VORP's own notice (vorp_core/client/notifications.lua)
        TriggerEvent('vorp:TipRight', ('You have %d unread telegram(s)'):format(count), 4000)
    end
    lastUnread = count
end

Restart frontier_mailbox after editing the file.

Frontier Forge — RedM documentation for VORP.