All products

np_environmental

Now and then something goes wrong in the city: a tree across a road, a burst water main, a dumpster fire. It stays wrong until players notice it, call it in and the right faction clears it. Factions are never notified automatically.

v1.0.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_npchandler 1.1.0+ · np_prophandler 1.1.0+
Price TBAStore link follows at release
InstallationDocumentation
Version
1.0.0
Frameworks
ESX, qbx, qb, standalone
Dependencies
oxmysql, np_npchandler 1.1.0+, np_prophandler 1.1.0+
Database
Tables created and seeded on first start
Inventory
np_inventory, ox_inventory, qb-inventory or none
Starter content
20 scenes, 52 example spawn points
Optional
np_hud, np_phone, np_menu, np_admin, np_character, np_discord, np_gangs, np_drugs, np_banking
Languages
English, German
Build
Node.js to build the NUI once
Discovery: a fallen tree across Route 68 with markers on the tree, the branches and the stump, the scene card (not reported, getting worse, who can clear it) and the prompts to inspect, call it in or drag off the branches
Discovery: a fallen tree across Route 68 with markers on the tree, the branches and the stump, the scene card (not reported, getting worse, who can clear it) and the prompts to inspect, call it in or drag off the branches

Taken from the NUI in the browser at 1920×1080 with mock data. The catalogue is the design render.

What's in it

Inspired by GTA World's Environmental Events: admin-made events, picked by weight, rolled every 7–9 hours at a 50% chance, gone after their lifetime, and nobody is told.

Director and quiet spawns

  • A roll every 7–9 hours, random inside the window. Half the time nothing happens.
  • A free spawn point with nobody within 150 m. Nobody is told, not even staff chat.

Discovery

  • Markers and the scene card only for players within 35 m who can see it.
  • Inspecting it up close makes a report precise and reveals clues.

Reporting

  • The Scene app in np_phone, the /report form or a real 911 / 311 call near the scene.
  • Reports route by service. A wrong service has to hand it over.

Faction scene board

  • Only what was reported, in the callers' words, with pins where they said.
  • No report, no faction ever sees it. Accept sets the GPS.

Clean-up tasks

  • Tasks in order, some needing an item, a vehicle or more people.
  • Civilians can do the light ones. A scene that sits gets worse in stages.

Payouts

  • The faction pay times the stage multiplier, split by share of work.
  • A finder's tip for the first useful caller and a good citizen rank.

Staff editor and director

  • Templates, weights, scene layout, stages, tasks, pay and spawn points, edited in game.
  • The next roll, a 7-day history, live scenes and the pick odds.

20 starter scenes

  • From a fallen tree to a light aircraft down, with 52 example spawn points.
  • Seeded into an empty installation on first start. After that the editor owns them.

A closer look

How it plays

From the roll to the payout. Every number below is a default in shared/config/, and staff can change the director, radii and payout live in np_admin.

  1. Roll: every 7–9 hours, random inside the window, the director rolls. Half the time nothing happens.
  2. Spawn: on a hit it picks a template by weight (enabled, weather and time met, not on cooldown, a faction on its list on duty) and a free spawn point nobody is looking at.
  3. Find: players who come close and have line of sight see the markers and the scene card. Inspecting it makes a report precise and reveals clues.
  4. Report: in the phone app, the /report form or a real 911 call near the scene. 311 city services or 911 emergency. No report, no faction ever sees it.
  5. Respond: the faction board shows the report in the callers' words. Accept sets the GPS.
  6. Clear: tasks in order (close the road, cut the trunk, winch it off), some needing an item, a vehicle or more people. Civilians can do the light ones.
  7. Pay: the faction pay times the stage multiplier, split by share of work. The first useful caller gets a finder's tip.
  8. Or not: a scene that sits gets worse in stages. After its lifetime it disappears, once nobody is watching.

Discovery and reports

You report what you saw. A precise report needs an inspection, a vague one drops a pin up to 120 m from where you stood.

The Scene app in np_phone: call it in, your report with its timeline, nearby scenes you have seen and the road closures
  • Markers and the scene card appear within 35 m with line of sight. Inspect within 8 m for clues.
  • Scene app: report with a photo, follow your report, nearby scenes, closures and the faction board. Without np_phone, /report opens the same form as a screen.
  • Voice reports: a caller on an np_phone emergency line (911, or a 311 line you add) who sends the location near a scene they have seen adds a report to it.
  • Live progress: reporters and the crew see "2 of 5 tasks done" in the Dynamic Island while it is cleared.
  • Good citizen rank: useful reports raise it, false ones cost it. Too many false reports in an hour and reports are refused.

The faction scene board

/scenes or F6 for faction members, or the Board tab in the phone app. Unreported scenes never show here: if nobody calls, nobody knows.

Public Works scene board: a burst main with five calls, what the callers said, first report, unit accepted, on scene and cleared, and accept and route
FactionService
Public Works311 city services
Tow311 city services
Park Rangers311 city services
Weazel News311 city services, no duty needed
Fire Department911 emergency
Police911 emergency
EMS911 emergency

Factions are framework jobs with a minimum grade (Config.Factions), and a job may belong to several. Other resources add factions with RegisterFaction.

Clean-up and pay

Every task is checked on the server: the right faction, the item, the vehicle nearby, enough people and the tasks before it.

Clean-up of a fallen tree: three on scene with their shares, close the road and check for power lines done, cutting the trunk with a chainsaw, winching locked until the cut is done
  • Make it safe, clear it, optional: tasks in groups and in order. Place cones, inspect, drag, hold to work or bring a vehicle.
  • Tools as items: chainsaw, cones, road flares, absorbent, a hazmat suit, a valve key, a pry bar, bolt cutters and insulated gloves. Cones and flares are usable.
  • Hazards: live wires, gas, fumes and fire hurt until their task is done. Insulated gloves or a hazmat suit protect where the scene asks for them.
  • Stages: a scene that sits gets worse, pays more and can add a faction, like EMS once a fallen tree turns critical.
  • Pay by share: nobody gets less than a tenth of an even split, optional tasks pay a bonus, a $150 finder's tip, and players who left are paid on their next join. /event cleanup still works, at half pay.

The staff editor and director

/envadmin and /envdirector. Templates and spawn points live in the database and are edited in game.

Staff editor with the fallen tree: weight 24 of 96, the layout of trunk, branches, stump, cones and sound, the fresh, worse and critical stages, weather and the factions with their pay
  • Editor: weights, lifetime, players and factions on duty, time and weather, the scene layout relative to an anchor, stages, tasks, pay and spawn points. Test spawn here.
  • Spawn points where you stand, or zones you walk the corners of. One layout fits every point.
  • Director: the next roll, the rules, a 7-day history of rolls, live scenes on a map and what the next roll would pick.
  • Roll now, spawn a pick, pause spawns, clear all scenes, teleport to a scene or remove it.
  • No ACE: np_admin nodes, or Config.Admins, framework admin groups and np_discord roles.

The 20 starter scenes

Vanilla GTA V props, peds and vehicles. Labels, tasks and clues are template data: staff rewrite or translate them in the editor.

SceneWho clears it
Fallen treePublic Works, Fire, Police, EMS, civilians help
Burst water mainPublic Works
Dumpster fireFire
Abandoned wreckPolice, Tow
Dead traffic lightsPublic Works, Police
Downed power linePublic Works, Fire
Loose livestockPolice, Park Rangers, civilians help
RockslidePublic Works
Fuel spillPublic Works, Fire
Illegal dumpingPublic Works, Police
SceneWho clears it
Flooded underpassPublic Works, Tow, only in rain or thunder
Gas leakFire, Police
Brush fireFire, Park Rangers, only in dry weather
Boat adriftPolice, civilians help
Scaffold collapseFire, EMS
Chemical drumFire
SinkholePublic Works, a fenced sinkhole follows
Beached whalePark Rangers, Weazel News, civilians help
Light aircraft downFire, Police, EMS, Weazel News
Something fellPolice, Weazel News, staff spawn only

Set it up

Compatibility

At start the server prints one status line per sibling: active, fallback or a missing export. np_npchandler and np_prophandler, both 1.1.0 or newer, are required, every other integration is optional and can be switched off.

KindSupported
Frameworkes_extended (first-class), qbx_core, qb-core or standalone
Inventorynp_inventory (items registered at runtime), ox_inventory, qb-inventory or none
Society paynp_banking, ESX esx_addonaccount, qb-banking, Renewed-Banking or qb-management
Dispatch911 reports through np_drugs' dispatch (ps-dispatch, cd_dispatch, qs-dispatch, core_dispatch) when np_phone is not running
Staffnp_admin, or Config.Admins, framework admin groups and np_discord roles. No ACE
NP DEV resourceWhat np_environmental does with it
np_inventoryTool items registered at start, usable cones and flares
np_phoneThe Scene app, faction alerts with Accept, the live island, receipts, 911 / 311 voice reports
np_hudToasts, prompts and progress bars
np_menuInspect, Report and Work on it on scene objects, a radial Report a scene
np_adminPermission nodes, live settings, the log and staff tools
np_characterCharacter names in reports and crews
np_gangsDumping in a held turf raises police attention, bandana clues
np_drugsChemical scenes near labs, police dispatch fallback
np_bankingFaction pay into the society account
np_discordStaff by Discord role and a log channel

Installation

The tables are created on first start and an empty installation is seeded with the 20 starter scenes and 52 example spawn points.

  1. Put the folder in your resources as np_environmental.
  2. Build the NUI once:
    cd web && npm install && npm run build
  3. Start it after oxmysql, your framework and inventory, and any np_* siblings you use:
    ensure oxmysql
    ensure es_extended      # or qbx_core / qb-core (optional)
    ensure np_inventory     # optional, or ox_inventory / qb-inventory
    ensure np_hud           # optional
    ensure np_phone         # optional
    ensure np_npchandler    # required, 1.1.0+
    ensure np_prophandler   # required, 1.1.0+
    ensure np_environmental
  4. Map the factions to your job names in shared/config/00_core.lua (Config.Factions).
  5. Items: np_inventory needs nothing. ox_inventory and qb-inventory: add the items from the docs.
  6. Check the example spawn points on your map before going live. English or German with Config.Locale.

For your own scripts

Server and client exports, hooks that can veto or change a spawn, a task, a clear or a payout, and server events for every step.

-- spawn a scene (nil = the director's pick of a free spawn point)
local id, err = exports.np_environmental:SpawnScene('fallen_tree', nil, { quiet = true })

-- a hook: double every payout
exports.np_environmental:registerHook('payout', function(p)
  for _, row in ipairs(p.payouts) do row.amount = row.amount * 2 end
end)

-- an event for every clear
AddEventHandler('np_environmental:cleared', function(scene, reason, payouts)
  print(scene.label, reason, #payouts)
end)

-- your own scene, picked by the director like any other
exports.np_environmental:RegisterTemplate(myTemplate)

Questions

Are factions told when a scene spawns?

No. Nobody is told, not even staff chat. A faction only sees a scene once a player reports it, in the callers' words and with the pin where they said.

What happens when nobody finds it?

It gets worse in stages while it sits. After its lifetime (90 minutes to four hours for the starter scenes) it expires and is removed once nobody is within 120 m.

Can civilians help?

Yes. Light tasks like dragging off branches are open to everyone, civilian help raises the good citizen rank, and the first useful caller gets a finder's tip.

Does it use ACE permissions?

No. With np_admin the nodes np_environmental.admin, .director, .editor and .cleanup decide. Without it, staff are Config.Admins, framework admin groups and np_discord roles.

Do I need the other NP DEV resources?

Two of them, both 1.1.0 or newer: np_npchandler and np_prophandler spawn every scene ped and prop. np_phone, np_hud, np_menu and the rest are used while they run, each with a built-in fallback.

Is it in German?

English and German, for the Lua messages and the NUI, set with Config.Locale.

Works well with

Build once, ensure it, wait for the first tree to fall.

Installation, configuration, exports, hooks and events are in the docs.

np_environmental docs