Skip to content

tw.witness

Side: Server + Client

Witness alert system that broadcasts notifications and temporary map blips to players with specific jobs (e.g., law enforcement).

Functions

tw.witness.report(jobs, title, message, coords, blipDuration?)

Server-side only. Sends a witness alert to all online players whose job matches one in the list.

ParameterTypeDefaultDescription
jobstableArray of job names to notify (e.g., {"police", "sheriff"})
titlestringAlert title
messagestringAlert description
coordsvector3World coordinates for the blip
blipDurationinteger?600000 (10 min)Duration in ms before the blip is removed

Client behavior

The client side is handled automatically. When a report is received:

  1. A notification is displayed to the player.
  2. A temporary blip is created at the given coordinates.
  3. The blip is automatically removed after blipDuration milliseconds.

You do not need to write any client-side code for tw.witness.

Examples

Report a crime from server.lua

lua
-- Alert all police and sheriffs about a robbery
tw.witness.report(
    {"police", "sheriff"},
    "Robbery Reported",
    "A witness saw someone robbing the Valentine store",
    vec3(-301.62, 783.04, 117.75)
)

Custom blip duration (2 minutes)

lua
tw.witness.report(
    {"police"},
    "Suspicious Activity",
    "A citizen reported suspicious activity near the saloon",
    vec3(2696.72, -1450.12, 45.26),
    120000
)

Notes

  • Only players whose current job matches one of the jobs entries will receive the alert.
  • The blip is automatically cleaned up after the duration expires — no manual removal needed.
  • Default blip duration is 10 minutes (600,000 ms).

Premium RedM Scripts — Multi-Framework