Robbery Requests · origen_ilegalv2
The Robbery Request module lets gang members submit a formal robbery request to the police department directly from the gang panel. The police then approve or reject it, and the gang can see the status in real time.
This module is completely independent from origen_robberies. It does not start or manage the robbery itself — it only handles the request/approval handshake between the gang and the police.
The Robbery Requests tab only appears in the gang panel if origen_police is running. If the resource is stopped or not installed, the tab is hidden automatically.
Configuration (config/robbery_request.lua)
Config.RobberyRequest.Enabled = true -- enable/disable the entire module
Config.RobberyRequest.Permission = 'request_robbery'
Config.RobberyRequest.Anonymous = true
Config.RobberyRequest.PendingExpireMinutes = 15
Config.RobberyRequest.ApprovedExpireMinutes = 30| Key | Type | Default | Description |
|---|---|---|---|
Enabled | boolean | true | Toggle the entire module. Even when true, the tab hides if origen_police is not started. |
Permission | string | 'request_robbery' | Rank permission required to submit and cancel requests. Leaders always have it. See Configuration. |
Anonymous | boolean | true | If true, the police panel shows "Anonymous" instead of the real gang name and requester name. The gang ID is still sent internally for validation. |
PendingExpireMinutes | number | 15 | Minutes before a pending request expires if police do not respond. 0 = no expiry. |
ApprovedExpireMinutes | number | 30 | Minutes before an approved request expires if the gang does not start the robbery. 0 = no expiry. |
Robbery list (Config.RobberyRequest.Requests)
Each entry in the list represents one type of robbery available to request.
Config.RobberyRequest.Requests = {
{
id = "small_robbery",
label = "Small Robbery",
image = "https://r2.fivemanage.com/.../small_rob.png",
active = true,
requiredCops = 1,
minParticipants = 1,
maxParticipants = 3,
cooldownSeconds = 900,
rejectedRequestCooldownSeconds = 300,
},
{
id = "medium_robbery",
label = "Medium Robbery",
image = "https://r2.fivemanage.com/.../med_rob.png",
active = true,
requiredCops = 4,
minParticipants = 2,
maxParticipants = 6,
cooldownSeconds = 1800,
rejectedRequestCooldownSeconds = 600,
},
{
id = "large_robbery",
label = "Large Robbery",
image = "https://r2.fivemanage.com/.../big_rob.png",
active = true,
requiredCops = 6,
minParticipants = 4,
maxParticipants = 6,
cooldownSeconds = 3600,
rejectedRequestCooldownSeconds = 900,
},
-- add as many entries as needed
}| Field | Type | Description |
|---|---|---|
id | string | Unique stable identifier for the robbery. Used in exports and status checks. |
label | string | Display name shown in the gang panel. |
image | string | Card image URL. Leave as "" for a placeholder. |
active | boolean | If false, the entry is hidden from the panel and cannot be requested. |
requiredCops | number | Minimum on-duty officers required to request this robbery. |
minParticipants | number | Minimum participants the gang must declare (inclusive). Must be >= 1. |
maxParticipants | number | Maximum participants (inclusive). Must be >= minParticipants. |
cooldownSeconds | number | Wait time (seconds) after completing the robbery before this same robbery can be requested again (uses origen_robberies). 0 = no cooldown. |
rejectedRequestCooldownSeconds | number | Time (seconds) the gang must wait before requesting this robbery again after the police reject it. Only blocks this robbery; others are unaffected. 0 = no rejection cooldown (the gang can request again immediately after marking the rejection as read). |
Validation rules
idmust be unique across all entries.minParticipants >= 1andmaxParticipants >= minParticipants.requiredCops >= 0,cooldownSeconds >= 0andrejectedRequestCooldownSeconds >= 0.
Request states
| State | Description |
|---|---|
pending | Submitted, waiting for a police response. |
approved | Approved by police. The gang has ApprovedExpireMinutes to start. |
rejected | Rejected by police. The gang must acknowledge the rejection before re-requesting. |
cancelled | Cancelled by a gang member with request_robbery permission. |
expired | Timed out without a response (pending) or without starting (approved). |
started | The robbery started (terminal — set by origen_police). |
Allowed transitions
pending → approved | rejected | cancelled | expired
approved → cancelled | started | expired
started → (terminal)
rejected → (terminal — gang must acknowledge)
cancelled→ (terminal)
expired → (terminal)rejected is not immediately terminal in the gang cache. It stays visible until the gang member acknowledges it (button in the panel), which then clears the entry and allows re-requesting.
Gang-side flow
- A member with
request_robberyopens the gang panel and navigates to Robbery Requests. - They select a robbery, choose the number of participants, and submit.
- The server validates: cooldown, cops online, participant range, and that no
pendingrequest already exists for the gang. - If valid, the request is forwarded to
origen_policeand cached aspending. - Status updates arrive in real time — the NUI reflects changes without the player refreshing.
- If rejected, the panel shows the rejection reason (provided by police). The member must tap the dismiss button to clear it. After acknowledging, a per-robbery cooldown (
rejectedRequestCooldownSeconds) may still block re-requesting that specific robbery for some time; other robberies are unaffected. - If approved, the gang has the configured time to initiate the robbery.
- If the gang wants to abort, they can cancel (any state except
started).
Anonymous mode
When Config.RobberyRequest.Anonymous = true:
- The police panel receives
gangLabel = "Anonymous"andrequestedBy = "Anonymous". - The
gangIdis still transmitted internally soorigen_ilegalv2can validate ownership and cancellations. - The police UI must not expose the real gang identity.
To reveal the gang identity to police, set Anonymous = false.
Checking request status from external scripts
Use the server-side exports documented in Exports to gate robbery scripts behind a valid approved request:
-- Gate: only allow starting the robbery if approved
local res = exports['origen_ilegalv2']:GetRobberyRequestStatus(source, 'paleto_bank')
if not res.ok or res.status ~= 'approved' then
return -- block
endTroubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Tab not visible in gang panel | origen_police is not started | Start origen_police before origen_ilegalv2 |
| "Police unavailable" error on submit | origen_police stopped mid-session | Restart origen_police; the cache is cleared automatically |
Gang stuck with a pending request | Police did not respond before PendingExpireMinutes elapsed | Request will auto-expire; lower PendingExpireMinutes if needed |
| Cannot re-request after rejection | Rejection not acknowledged, or rejectedRequestCooldownSeconds still active | Dismiss the rejection notification first; if a cooldown is configured, wait for it to expire (only blocks the same robbery) |
| Cooldown still active after restart | Cooldown is in-memory only and resets on resource restart | Expected behavior — no persistent cooldown across restarts |