Paid scripts
Witnesses
Every crime in town can have a witness who runs to tell the law. Catch them before they get away, or on-duty lawmen get an alert, and an optional NPC posse rides out when nobody is on duty.
Overview#
When a player commits a crime in town, a nearby townsperson sees it. They flinch, point and shout (or put their hands up if you are armed), then run. If they get far enough away and stay away long enough, they report it, and the on-duty law gets an alert with a blip, an area circle and a route to the spot. Stop the witness first and nobody hears about it.
When no lawman is on duty, an optional posse of NPC lawmen can ride in instead. Players can fight, flee or surrender to it.
- Crimes it notices: shooting (including a shot fired in town near nobody), threatening someone with a weapon, fist fights and melee, lassoing, trampling, stealing a horse or wagon, riding with a hogtied person, looting a body and poaching. Each one can be switched on or off and has its own chance.
- Law alerts say what happened, where (the town, or the nearest one) and at what time. The same crime by the same player alerts the law at most once a minute.
- Duty from your law script: ready-made settings for outsider_policeman, vorp_police, rsg-lawman, qbr-policejob and bcc-law, picked automatically, plus a custom option for any other duty script.
- Call commands for players:
/callpolice,/calldoctor,/undertaker,/calltrain, and any you add for other jobs. - Alerts for your other scripts: robbery, break-in, bounty, drug sale and more, fired by those scripts.
- Blips that wait until the responder arrives, if you want them.
- Where it works: only inside the towns you list, or everywhere, with areas where nothing is ever noticed (Sisika, Van Horn and Wapiti by default).
- NPC law response (off by default) and a built-in Sisika jail for NPC arrests (off by default).
- English, Spanish and French.
Requirements#
| What | Needed? | Why |
|---|---|---|
| VORP Core, RSG Core or QBCore RedM | Yes | Witnesses never talks to your framework directly; it goes through poggy_core. |
| poggy_core 0.14.0 or newer | Yes | The framework layer every Poggy script runs on. Free. |
| PolyZone | Yes | Draws the town and blacklist zones. The resource must be named PolyZone. |
| A duty script | No | Says which lawmen are on duty: outsider_policeman, vorp_police, rsg-lawman, qbr-policejob, bcc-law, or any other through the custom option. Without one, Witnesses uses your framework's job duty where it has one; when nothing can say, every law job counts as on duty. |
| A jail script with a server export | No | Lets NPC arrests send a player to jail. Witnesses also has its own Sisika jail (off by default). |
No database tables are needed. The built-in jail keeps its sentences in the resource's own server storage.
The NPC law response needs the server to allow entities made by players' games. With sv_entityLockdown set to strict or relaxed the posse cannot appear, and the server console says so.
Installation#
- Install and start poggy_core and PolyZone.
- Download Witnesses from your Cfx.re portal and put the
poggy_witnessesfolder in yourresourcesfolder. - In
server.cfg, start it after poggy_core and PolyZone:ensure poggy_core ensure PolyZone ensure poggy_witnesses - Restart the server.
- Check your law job names and grades (see Configuration), then type
/witnessdutyin the server console to see which duty script it found.
Coming from the old Witnesses folder
From 1.2.0 the folder is called poggy_witnesses.
- Copy your settings out of the old
config.luaandconfig_npc.lua(andtranslations.luaif you changed any text). - Delete the old
Witnessesfolder and putpoggy_witnessesin its place. - In
server.cfg, changeensure Witnessestoensure poggy_witnesses. - Put your settings back:
config.luais nowconfig/config.lua,config_npc.luais nowconfig/npc.lua, andtranslations.luastays next tofxmanifest.lua. - If another script used
exports.Witnesses:...or thewitnesses:...server events, change them toexports.poggy_witnesses:...andpoggy_witnesses:....
Configuration#
Every setting can be changed in game: type /poggy and choose Witnesses. Each setting has a description. Changes need a restart of the script, which the hub offers. Some settings only show with Show advanced on.
If you prefer editing files:
| File | What it holds |
|---|---|
config/config.lua | Witnesses, crimes, towns, law jobs, duty, alert blips, job alerts, ignored items and NPCs |
config/npc.lua | The NPC law response and the built-in jail |
translations.lua | The language (Config.Language: "en", "es" or "fr") and every message |
Witnesses (General tab)
| Setting | Default | What it does |
|---|---|---|
Cooldown between reports Config.WitnessCooldown | 120 seconds (written as 120000 ms) | Once a witness event is over, no new one can start for this long. |
Most witnesses at once Config.MaxActiveWitnesses | 3 | How many townsfolk can be running to report at the same time. More is harder to stop. |
Witness search radius Config.WitnessSearchRadius | 40 m | How far from the crime the script looks for someone to be the witness. |
Players can be victims Config.AllowPlayersAsVictims | On | Crimes against other players can be witnessed. Players are never witnesses themselves. |
Hide the big WITNESS messages Config.DisableTopNotifications | Off | Turns off the large top-of-screen messages for the player who was seen. Alerts to jobs still show. |
Fleeing and reporting (Config.WitnessEscape):
| Setting | Default | What it does |
|---|---|---|
Escape distance RequiredDistance | 20 m | How much further away than where they started a witness must get before they start reporting. Higher gives players more time. |
Give-up time MaxEscapeTime | 120 seconds | A witness who has not reported by then gives up. |
Time to report ReportGracePeriod | 8 seconds | How long a witness must stay away before the report is made: the player's last chance. |
Instant report multiplier ForcedReportMultiplier | 2 | A witness this many times the escape distance away reports at once. |
Show witness blips EnableBlips | On | A blip on each witness for the player they saw. |
Reaction delay ReactionDelay | 1.2 seconds | How long a witness stops and turns toward you before running. 0 makes them run at once. |
Three optional keys can be added to Config.WitnessEscape by hand. All are on when left out: Reactions (flinch, point, shout or hands up before running), Shout (witnesses shout as they react and run) and IgnoreScriptPeds (NPCs that belong to other scripts, such as shopkeepers and job NPCs, never become witnesses).
Crimes
Each crime in Crimes witnesses notice (Config.Checks) has an on/off switch, a chance (percent) and the alert it sends.
| Crime | On by default | Chance |
|---|---|---|
| Shooting (shooting at or near people, or firing in town) | Yes | 100% |
| Threatening (aiming a weapon at someone) | No | 50% |
| Melee (fist fights and melee weapons) | No | 30% |
| Lassoing | No | 75% |
| Trampling (riding someone down) | No | 100% |
| Hijacking (stealing a horse or wagon) | Yes | 80% |
| CarryingHostage (riding with a hogtied person) | Yes | 90% |
| Looting (searching a dead body) | No | 75% |
| Poaching (killing a protected animal) | No | 75% |
| Setting | Default | What it does |
|---|---|---|
Poaching: protected animals Config.PoachingAnimals | buffalo, tatanka buffalo, eagle, moose, panther | Animal model names whose killing counts as poaching. |
Minimum horse speed Config.Checks.Trampling.MinSpeed | 1.0 | The horse must be moving faster than this for a hit to count as trampling. |
Trampling victim radius Config.VictimDetectionRadius | 3 m | How close to your horse someone must be to count as trampled. |
Items that are not threatening Config.NonThreateningAimItems | lassos, cameras, binoculars, lanterns, torch, fishing rod, metal detector | Aiming these never counts as a threat. |
NPCs that never witness Config.BlacklistNPCs | a long list of lawmen, guards, bandits and job NPCs | Ped models that are never picked as witnesses. |
Locations
| Setting | Default | What it does |
|---|---|---|
Only in towns Config.EnforceTownLimits | On | On: crimes are only noticed inside the enabled towns. Off: everywhere. |
Use blacklisted areas Config.EnforceBlacklistTowns | On | Nothing is noticed inside a blacklisted area, even where it overlaps a town. |
Towns Config.Towns | Saint Denis, Rhodes, Annesburg, Valentine, Emerald Ranch, Strawberry, Blackwater, Tumbleweed, Armadillo, Colter, Thieves Landing | Each has a name, a centre, a radius in metres and an on/off switch. |
Blacklisted areas Config.BlacklistedTowns | Sisika Penitentiary, Van Horn, Wapiti | Same shape as towns. Good for prisons, law camps and event areas. |
To add a town in game: stand in the middle of it, open the Towns list, choose Add town, give it a name, use Use my position on Centre and set the radius. The town's name also picks the NPC lawmen for that town (see NPC law response below).
Law jobs and duty (Access & permissions tab)
| Setting | Default | What it does |
|---|---|---|
Law jobs Config.PoliceJobList | police, sheriff, marshal | The jobs that count as law. Exact job names; capital letters matter. |
Law grades that get alerts Config.PoliceJobRanks | grades 0 to 5 for each law job | A grade not listed here gets no law alert. If your grades start at 1 or go above 5, add them. |
Law immunity Config.LawImmunityEnabled | On | Witnesses ignore crimes by lawmen who are on duty. An off-duty lawman is witnessed like anyone else. |
Only alert on-duty law Config.DutyCheckEnabled | On | Law jobs only get law alerts while on duty. Other jobs, such as doctors, are always alerted. |
Duty script Config.Duty.Preset | "auto" | Where the on-duty answer comes from (table below). |
When the duty script cannot say Config.Duty.Fallback | "job_only" | When no duty script is running: "job_only" counts every law job as on duty, "off_duty" counts nobody. |
Your own duty script Config.Duty.Custom | empty | For the "custom" preset: the resource name, its server export that takes the player and job and returns true when on duty, and/or a player state bag that is true when on duty. |
| Duty script | For | How it knows |
|---|---|---|
"auto" | Most servers | Uses the first of the scripts below it finds running, then your framework. |
"outsider_policeman" | outsider_policeman | Its on-duty export. |
"vorp_police" | vorp_police | Its on-duty state. |
"rsg_lawman" | rsg-lawman | rsg-core's job duty, through poggy_core. |
"qbr_policejob" | qbr-policejob | qbr-core's job duty, through poggy_core. |
"bcc_law" | bcc-law, bcc-society | Off duty renames the job (for example offpolice), so a law job is on duty. |
"framework" | No law script | poggy_core's own answer. |
"job_only" | No duty system | Everyone with a law job counts as on duty. |
"custom" | Any other duty script | What you fill in under Your own duty script. |
The older Config.DutyExportCall (a line of Lua that returns true when on duty) still works while the preset is "auto" or "custom". It runs as code, so it can only be changed in the file.
Alerts
| Setting | Default | What it does |
|---|---|---|
Alert cooldown Config.AlertCooldown | 60 seconds | How long before the same crime by the same player alerts the law again. A different crime alerts at once. 0 turns it off. Player calls such as /callpolice use their own cooldown. |
Alert area size Config.BlipRadius | 50 m | The shaded circle drawn around every alert. |
Blips that wait for you Config.PersistentBlipEnabled | On | Lets alerts marked Stay until reached keep their blip until the responder arrives. |
Arrival distance Config.PersistentBlipClearDistance | 25 m | How close the responder must get for a waiting blip to clear. |
Alerts say where and when the crime happened. To leave that out, add Config.AlertDetails = false to config/config.lua.
Job alerts (Config.Alerts) is the list of every alert and its command. Each row has a title, a command (without the slash), the message to responders, the message to the caller, the jobs and grades alerted, the blip, how long the blip stays, whether to set a route, and optionally a cooldown in seconds, Stay until reached and Ignore duty (law jobs get it even off duty). Every command must be unique. A job in the row with no grades listed only alerts grade 0.
To add your own call command, such as /callblacksmith: open the Job alerts list, duplicate a close one such as NEED DOCTOR (or choose Add alert), fill in the row, save and restart Witnesses.
NPC law response (config/npc.lua)
Off by default. When on, a posse of NPC lawmen rides out after a witness reports a crime and no player lawman is on duty.
| Setting | Default | What it does |
|---|---|---|
Enabled Config.LawResponse.Enabled | Off | The master switch. |
Player lawmen first PlayerLEOPriority | On | The posse only rides out while no player lawman is on duty. This is the "NPC law when no law is on duty" switch. |
Crimes that send NPC law EngagedCrimes | Shooting, Hijacking | Only these crimes bring a posse. Others still alert player lawmen. You can add Threatening, Melee, Lassoing, Trampling, CarryingHostage, Looting, Poaching, and any crime your other scripts send. |
Response time ResponseTime | 8 seconds | How long after the report the posse sets out. The player is warned at once. |
Response duration Duration | 5 minutes | The longest the posse keeps hunting. |
Spawn distance SpawnDistance | 80 m | How far away officers appear. Anything under 70 m is raised to 70 m. |
Escape distance DespawnDistance | 100 m | Stay this far from every officer for about 10 seconds and the player has escaped. |
Officer blips EnableBlips | On | Shows each officer on the map. |
Allow surrender AllowSurrender | On | Lets a wanted player surrender instead of fighting. |
Surrender movement tolerance SurrenderMovementTolerance | 2 m | Moving further than this drops the surrender. |
Jail time by severity JailTime | Low 10, Medium 20, High 30 minutes | Minutes in jail after an arrest, when something can jail (see Using it in game). |
Jail call JailExportCall | empty | A line of Lua that jails the player through your jail script. File only. |
Use the built-in Sisika jail BuiltinJail.Enabled | Off | Witnesses' own jail for NPC arrests. |
Crime severity CrimeSeverity | Shooting High; Threatening, Melee, Trampling, Hijacking Medium; Lassoing Low | A crime not listed counts as Medium. |
| Officer horses, Officer weapons | four horses, four guns | Picked at random for each officer. |
Posse models by town Config.TownLawModels | local lawmen for each shipped town | The town name must match a name in Towns. |
Posse models outside towns Config.DefaultLawModels | bounty hunters | Used outside any listed town. |
Posse by severity (ResponseTypes):
| Severity | Officers | On horseback | Aggressiveness | Chance to respond |
|---|---|---|---|---|
| Low | 2 to 3 | 25% | 1 | 100% |
| Medium | 3 to 5 | 50% | 3 | 100% |
| High | 5 to 6 | 75% | 5 | 100% |
Optional fine-tuning keys can be added to Config.LawResponse in config/npc.lua. Without them these defaults apply:
WarnBeforeFiring = true, -- call out and hold at gunpoint before firing
WarnDistance = 25.0, -- metres at which they call out
WarnTime = 6, -- seconds to surrender before they open fire
DismountDistance = 20.0, -- a rider gets off when the player is on foot this close
Accuracy = nil, -- 0-100; nil = by severity (about 30 low to 55 high)
RepositionStuck = true, -- a stuck officer out of sight is moved nearer
EscapeTime = 10, -- seconds beyond DespawnDistance to escape
DespawnTimeout = 30, -- seconds to leave out of sight before being removed anyway
Speech = true, -- officers call out and shout orders
The built-in Sisika jail
Off by default so it never fights a jail script you already run. Turn it on in /poggy → Witnesses → NPC law response → Use the built-in Sisika jail, or in config/npc.lua:
BuiltinJail = {
Enabled = true,
},
Every other key is optional and can be added under BuiltinJail by hand:
| Key | Default | What it does |
|---|---|---|
Center | vector3(3339.23, -670.12, 45.83) | Middle of the prison grounds. |
Radius | 70.0 | Size of the grounds in metres. Past it, the prisoner is brought back. |
Spawn, SpawnHeading | vector3(3339.07, -669.41, 45.83), 194.42 | Where a prisoner is put. |
Release, ReleaseHeading | vector3(2948.23, -1234.47, 42.48), 95.39 | Where a freed prisoner is put (the far bank, south-east of Saint Denis). |
Outfit | true | The prison uniform (multiplayer characters only). |
MaxMinutes | 240 | The longest sentence, for the staff command and arrests alike. |
AllowEscape | false | true: getting EscapeDistance metres past the grounds is an escape. The sentence ends and the player keeps running in the uniform. |
EscapeDistance | 30.0 | Metres past Radius that count as an escape. |
EscapeAlert | true | With escapes allowed, on-duty law gets a PRISON BREAK! alert. |
RestoreCommand | "" | RSG and QBR: the command that reloads a player's clothes. poggy_core can only reload clothes on VORP so far. |
JailCommand | "jail" | The staff jail command, without the slash. With vorp_police running (it has its own /jail) the default is "witnessjail". |
UnjailCommand | "unjail" | The staff release command ("witnessunjail" with vorp_police running). |
Advanced
| Setting | Default | What it does |
|---|---|---|
Debug output Config.Debug | Off | Prints witness and alert details to the F8 and server consoles. Leave off on a live server. |
NPC law debug Config.LawResponseDebugging | Off | Prints NPC law details to the consoles. |
Config.ShowZones (file only, not in the shipped config) | Off | Add Config.ShowZones = true to draw the town and blacklist zones on screen. |
Commands#
| Command | Who | What it does |
|---|---|---|
/callpolice | Everyone | Calls the law to your position. 120 second cooldown. |
/calldoctor | Everyone | Calls a doctor. The blip stays until they arrive. 120 second cooldown. |
/undertaker, /alertundertaker | Everyone | Calls the undertaker. |
/calltrain | Everyone | Asks the conductor for a pickup. |
/clearalerts | Everyone | Removes all your alert blips, including waiting ones, and your waypoint. |
/cleanalertblips | Everyone | Removes all your alert blips. Keeps your waypoint. |
/clearwaypoint, /clearmarker | Everyone | Clears your waypoint and route. |
/getmyweaponhash_cl | Everyone | Prints the weapon you hold, as the script sees it, to the F8 console. |
/witnesscheck | Everyone | Prints to F8 every check that decides whether a crime where you stand would be witnessed, even with debug off. |
/witnessduty | ACE command.witnessduty, console | Shows which duty script is read, the fallback, what jails after an NPC arrest, and every lawman's duty state. |
/witnesstestalert [crime] | ACE command.witnesstestalert, console (witnesstestalert <id> [crime]) | Puts one real crime alert (Shooting if none named) on your own screen only, as an on-duty lawman sees it. No posse, nobody else alerted. |
/jail <id|me> <minutes> [reason] | ACE command.jail, console | Sends a player to the built-in Sisika jail (it must be on), for at most MaxMinutes. me jails yourself. Called /witnessjail when vorp_police runs. |
/unjail <id|me> | ACE command.unjail, console | Releases a player from the built-in jail at once. Called /witnessunjail when vorp_police runs. |
/dumpalertgroups | ACE command.dumpalertgroups, console | Lists every player's job and grade, whether it is law and whether they are on duty. |
/debugalertsgroups | ACE command.debugalertsgroups, console | The same list, printed to the server console. |
The call commands come from the Job alerts list, so the names above are the ones it ships with; you can rename them or add more.
The same list also holds alerts meant for your other scripts to fire (robbery, break-in, bounty, drug sale, explosives, kidnapping, prisoner escape, train robbery, grave robbing and more). They have odd names on purpose. In 1.4.0 any player who knows an alert command can type it, so keep the names of these alerts hard to guess. The crime alerts (witness_shooting_alert and the others) are fired by Witnesses itself when a witness reports; a player who types one only starts a witness against themselves.
There are no keybinds.
Permissions#
Staff commands use the standard ACE permission command.<name>, and all of them also work from the server console. Give them to your admin group in server.cfg:
add_ace group.admin command.witnessduty allow
add_ace group.admin command.witnesstestalert allow
add_ace group.admin command.jail allow
add_ace group.admin command.unjail allow
add_ace group.admin command.dumpalertgroups allow
add_ace group.admin command.debugalertsgroups allow
If you renamed the jail commands, or vorp_police is running, use the command's real name (for example command.witnessjail).
Who gets which alert is set by job and grade, not ACE:
- Each row in Job alerts lists the jobs it reaches and, for each job, the grades.
- Law alerts use Law jobs and Law grades that get alerts. With Only alert on-duty law on, a lawman must also be on duty, as your duty script says. A row with Ignore duty on skips that.
- With Law immunity on, witnesses ignore crimes by lawmen on duty.
Using it in game#
For players committing a crime
- Commit a crime in a town (for example, fire a gun). If a townsperson sees it, they react, then run, and you are told someone saw you. A blip shows each witness.
- Stop them before they get away: catch them, chase them off, or worse. A witness must get far enough and stay away for a few seconds to report.
- If they report, on-duty law gets an alert. You are told the law is coming only when a lawman got the alert or a posse rides out.
- Once witnesses start, nothing new is noticed until that event is over (every witness stopped, or the posse has arrested you, killed you or lost you). Then the witness cooldown starts.
A player the duty script says is in jail is not reported and no posse is sent after them. outsider_policeman and rsg-lawman (with rsg-prison) can say this, and so can the built-in jail. They can still call for help.
For lawmen and other jobs
An alert shows a popup with what happened, where and when, a blip, an area circle and, if the row says so, a route. /clearalerts clears it all; /clearwaypoint clears just the route. Players call you with /callpolice, /calldoctor and the others.
The NPC posse
- Officers appear at least 70 m away, out of your sight, on a road where there is one. Riders arrive in the saddle.
- Within about 25 m they call out and hold you at gunpoint for a few seconds. Shooting, drawing on them, running or waiting it out starts the fight.
- They fight only you, never bystanders or other lawmen, and get off their horses to chase you on foot.
- Get far enough away for about 10 seconds and you have escaped. Kill them all and it ends. When it is over they ride or walk off and vanish out of sight.
Surrendering and jail
- On foot, with the posse close, hold the surrender prompt. Your hands go up.
- The officers hold fire and walk in with guns drawn. One walks round behind you, takes hold of you, and only then are you cuffed. Moving too far or drawing a weapon breaks the surrender.
- You are jailed for Jail time by severity minutes if something can jail you, tried in this order:
- Jail call (
JailExportCallinconfig/npc.lua).src,charIdandtimeInSecondsare replaced with real values, for example"exports.another_jail:JailPlayer(src, timeInSeconds, 'Arrested by law')". - Your own jail export, added by hand to
Config.Duty.Custominconfig/config.luaasJailExport = "JailPlayer"(withResourceset). It is called with the player, minutes and a reason. - The built-in Sisika jail, when it is on.
- Jail call (
- With nothing that can jail, the officer takes the cuffs off after a moment, you are let go with a warning, and the posse leaves.
None of the supported duty scripts can jail from another script, so on a fresh install with the built-in jail off, arrests end with a warning.
The built-in Sisika jail
An arrested player fades out and wakes in Sisika Penitentiary in the prison uniform, weapons put away, with the time left at the bottom of the screen. Walking off the grounds, or respawning elsewhere after dying inside, brings them back. Time only counts while they are online, and it is kept over a relog and a server restart. When it is up their own clothes come back (on VORP automatically; on RSG and QBR set RestoreCommand) and they are faded to the far bank of the river, south-east of Saint Denis.
To try it: turn it on, restart Witnesses, then type /jail me 1.
For your own jail script, Witnesses can tell who is jailed if you add IsJailedExport = "IsJailed" (an export that takes the player) or JailedStateBag = "jailTime" to Config.Duty.Custom.
For developers#
Police alerts from other scripts
Raise a police alert from any server script. It goes to on-duty law only, uses the alert cooldown, and brings the NPC posse when nobody is on duty and the crime is in EngagedCrimes.
local ok, info = exports.poggy_witnesses:PoliceAlert({
src = source, -- the suspect (their position is used; they are told)
coords = vector3(x, y, z), -- or a position, when there is no suspect
title = "BANK ROBBERY",
message = "The Valentine bank is being robbed!",
crime = "Robbery", -- the cooldown key and the posse's crime
-- optional:
alert = "robbery198sd99720", -- start from a Job alerts row (its icon, blip, text)
jobs = { "sheriff" }, -- default: the Law jobs list
blip = "blip_cash_bag", blipTime = 120000, waypoint = true,
npcLaw = false, -- true: posse even if the crime is not engaged; false: never
notifySuspect = false,
suspectMessage = "Someone saw you!",
})
-- ok = false with info "cooldown", "no_position" or "jailed" when nothing was sent;
-- otherwise info = { sent = n, lawSent = n, npcLaw = true/false }
The same from a server event: TriggerEvent('poggy_witnesses:policeAlert', data) (server side only).
Send an existing Job alerts row as it is (no posse unless you name a crime):
exports.poggy_witnesses:TriggerAlertForPlayer(src, "graverobbing8x2kp19")
exports.poggy_witnesses:TriggerAlertForPlayer(src, "robbery198sd99720", { crime = "Robbery" })
Duty, jail and the posse
exports.poggy_witnesses:IsOnDuty(src) -- true when that lawman is on duty
exports.poggy_witnesses:GetOnDutyLaw() -- every on-duty lawman's server id
exports.poggy_witnesses:SetOnDuty(src, true) -- your duty script tells Witnesses (nil hands it back to the preset)
exports.poggy_witnesses:GetDutyPreset() -- "outsider_policeman", "vorp_police", ...
exports.poggy_witnesses:IsJailed(src) -- true when the built-in jail or the duty script says so
exports.poggy_witnesses:StartLawResponse(src, "Robbery", true) -- send the posse now (true: skip EngagedCrimes)
exports.poggy_witnesses:EndLawResponse(src)
exports.poggy_witnesses:IsWantedByNpcLaw(src)
The full witness flow for your own crimes
A witness must see it and get away before the alert is sent.
-- Server
local requestId = exports.poggy_witnesses:CreateWitness(source, "GraveRobbing", {
alertCommand = "graverobbing8x2kp19", -- a command from Job alerts
triggerLawResponse = true, -- send the NPC posse if reported
lawActionType = "Shooting", -- the crime the posse is sent for
})
-- Client
exports.poggy_witnesses:CreateWitnessLocal("GraveRobbing", { alertCommand = "graverobbing8x2kp19" })
The full option list is at the top of shared/api.lua, which is readable.
Server events
| Event | Arguments |
|---|---|
poggy_witnesses:onWitnessCreated, onWitnessStopped, onWitnessReported | src, actionType, requestId, data |
poggy_witnesses:onAlertSent | src, actionType, requestId, alertCommand |
poggy_witnesses:onPoliceAlert | src, alert, crime, info |
poggy_witnesses:onLawResponseStarted | src, id, crime, severity, officers |
poggy_witnesses:onLawResponseEnded | src, id, reason |
poggy_witnesses:onJailed | src, charId, minutes, reason (built-in jail) |
poggy_witnesses:onJailEnded | src, charId, why: served, staff, escape or quiet (character switch) |
Troubleshooting#
Lawmen get no alerts
Check the job name is in Law jobs (exact, capital letters matter) and the grade is in Law grades that get alerts; grades that start at 1 or go above 5 must be added. With Only alert on-duty law on, they must be on duty: /witnessduty shows which duty script is read and what it says for each lawman. Remember the alert cooldown: the same crime by the same player alerts once a minute.
Nothing is ever witnessed
With Only in towns on, crimes only count inside enabled towns. Check you are not in a blacklisted area, the crime is switched on with a chance above 0, and you are not a lawman on duty with law immunity on. Stand where it should happen and type /witnesscheck: it prints every one of these checks to F8. To see the zones on screen, add Config.ShowZones = true to config/config.lua.
Aiming a lasso or camera starts a witness
Add the weapon name to Items that are not threatening. /getmyweaponhash_cl shows the name the script sees.
A job NPC from another script runs off to report
Add its model name to NPCs that never witness.
The NPC posse never comes
The law response must be enabled, the crime must be in Crimes that send NPC law, and with Player lawmen first on, no player lawman may be on duty (/witnessduty). When nothing on the server can say who is on duty, every law job counts as on duty by default (When the duty script cannot say), so the posse stays home while a lawman is online. It sets out after Response time. With sv_entityLockdown on, the server will not let it appear.
Arrested players are let go with a warning
Nothing on the server can jail them. Turn on the built-in Sisika jail, or set a Jail call or jail export for your own jail script.
/jail does something else
vorp_police has its own /jail. With it running, Witnesses uses /witnessjail and /witnessunjail, or set your own names with JailCommand and UnjailCommand.
Released prisoners stay in the uniform on RSG or QBR
Set RestoreCommand under BuiltinJail to your server's command that reloads a player's clothes.
Two alerts for one crime
Another script (a dispatch system) also detects shots or fights. Turn its detection off, or have it call PoliceAlert instead.
A setting shows as read-only in /poggy
It is built from another setting (a job alert that uses the law jobs list or a translation), or it runs as code. Change the setting it comes from, or edit the file.
Updating#
Witnesses updates through poggy_core like every Poggy script: see Updates. Your config and translation files are merged, so new settings arrive with their defaults and your values stay.
If you rename the resource folder, sentences in the built-in jail saved under the old name are no longer seen, because they belong to the resource's own storage.