OrigenNetwork
Docs

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)

luaconfig/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
KeyTypeDefaultDescription
EnabledbooleantrueToggle the entire module. Even when true, the tab hides if origen_police is not started.
Permissionstring'request_robbery'Rank permission required to submit and cancel requests. Leaders always have it. See Configuration.
AnonymousbooleantrueIf true, the police panel shows "Anonymous" instead of the real gang name and requester name. The gang ID is still sent internally for validation.
PendingExpireMinutesnumber15Minutes before a pending request expires if police do not respond. 0 = no expiry.
ApprovedExpireMinutesnumber30Minutes 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.

luaconfig/robbery_request.lua
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
}
FieldTypeDescription
idstringUnique stable identifier for the robbery. Used in exports and status checks.
labelstringDisplay name shown in the gang panel.
imagestringCard image URL. Leave as "" for a placeholder.
activebooleanIf false, the entry is hidden from the panel and cannot be requested.
requiredCopsnumberMinimum on-duty officers required to request this robbery.
minParticipantsnumberMinimum participants the gang must declare (inclusive). Must be >= 1.
maxParticipantsnumberMaximum participants (inclusive). Must be >= minParticipants.
cooldownSecondsnumberWait time (seconds) after completing the robbery before this same robbery can be requested again (uses origen_robberies). 0 = no cooldown.
rejectedRequestCooldownSecondsnumberTime (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

  • id must be unique across all entries.
  • minParticipants >= 1 and maxParticipants >= minParticipants.
  • requiredCops >= 0, cooldownSeconds >= 0 and rejectedRequestCooldownSeconds >= 0.

Request states

StateDescription
pendingSubmitted, waiting for a police response.
approvedApproved by police. The gang has ApprovedExpireMinutes to start.
rejectedRejected by police. The gang must acknowledge the rejection before re-requesting.
cancelledCancelled by a gang member with request_robbery permission.
expiredTimed out without a response (pending) or without starting (approved).
startedThe robbery started (terminal — set by origen_police).

Allowed transitions

text
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

  1. A member with request_robbery opens the gang panel and navigates to Robbery Requests.
  2. They select a robbery, choose the number of participants, and submit.
  3. The server validates: cooldown, cops online, participant range, and that no pending request already exists for the gang.
  4. If valid, the request is forwarded to origen_police and cached as pending.
  5. Status updates arrive in real time — the NUI reflects changes without the player refreshing.
  6. 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.
  7. If approved, the gang has the configured time to initiate the robbery.
  8. 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" and requestedBy = "Anonymous".
  • The gangId is still transmitted internally so origen_ilegalv2 can 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:

lua
-- 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
end

Troubleshooting

SymptomCauseFix
Tab not visible in gang panelorigen_police is not startedStart origen_police before origen_ilegalv2
"Police unavailable" error on submitorigen_police stopped mid-sessionRestart origen_police; the cache is cleared automatically
Gang stuck with a pending requestPolice did not respond before PendingExpireMinutes elapsedRequest will auto-expire; lower PendingExpireMinutes if needed
Cannot re-request after rejectionRejection not acknowledged, or rejectedRequestCooldownSeconds still activeDismiss the rejection notification first; if a cooldown is configured, wait for it to expire (only blocks the same robbery)
Cooldown still active after restartCooldown is in-memory only and resets on resource restartExpected behavior — no persistent cooldown across restarts