Skip to main content
These exports run on the server. Most of what you’ll need lives here.

addMessage(target, options)

Send a chat message to one player or everyone. The most-used export.
Server
number | -1
required
Player server ID, or -1 to broadcast to every connected player.
string
required
The message text. Supports inline color codes and a small markdown subset (see below).
string
Author label. Usually a character name or system name.
string
Colored pill-style tag rendered before the title. Common uses: LSPD, EMS, ADMIN.
object
Optional second tag, useful for badge numbers.
string
Author color (#hex). Falls back to the active theme’s accent.
string
Built-in icon name, or any other string for plain text. Available icons: person, cloud, chat, envelope, megaphone, shield, heart, globe, alert, radio.
boolean
default:"false"
Adds a glow effect to highlight the message. Use sparingly.
object
Override the visual tag entirely.

Examples

System message
Police broadcast with badge
Special / glowing

Inline color codes

Two formats inside args:
Both can be mixed in the same message. Available SA:MP codes are ^0 (reset) and ^1 through ^9.

Markdown

Markdown is parsed after HTML-escaping — XSS-safe.

clearChat(target?)

Clear chat history for one player or everyone.
Server
number | -1 | nil
Player server ID. Pass -1 or omit to clear chat for all players.
Examples

setMuted(target, muted, durationMs?)

Mute a player so their messages are silently dropped server-side.
Server
number
required
Player server ID to mute / unmute.
boolean
required
true to mute, false to unmute.
number
Optional auto-unmute delay in milliseconds. Omit for indefinite mute.
Examples

isMuted(target)

Check whether a player is currently muted.
Server
number
required
Player server ID.
boolean
true if currently muted.

Missing an export you need? Ask in Discord — we ship new ones when there’s a real use case.