XyraLScripts
Installation guide

Air Drops

Contested supply drops announced to the server, flown in by cargo plane and cracked open by whoever holds the ground.

Requirements

Required

  • qbx_core or qb-core — the bridge detects which you run
  • ox_lib
  • oxmysql

Inventory

  • One of ox_inventory, qb-inventory, qs-inventory, codem-inventory, core_inventory or ps-inventory. The bridge detects it.
  • ox_inventory gets the best version: the crate is a real stash, pre-filled, that several people can loot at once. The others cannot be filled before they are opened, so those hand out loot per search instead.

Optional

  • ox_target — adds a target option on the crate. The key prompt works without it.
  • A dispatch resource — XS-Dispatch, ps-dispatch, qs-dispatch, cd_dispatch or core_dispatch. Falls back to a plain notification.

Installation

  1. Drop the XS-AirDrops folder into your resources directory.
  2. Import sql/airdrops.sql. It uses CREATE TABLE IF NOT EXISTS and is safe to re-run.
  3. Add ensure XS-AirDrops to your server.cfg, after ensure ox_lib and ensure oxmysql.
  4. Restart, then open the panel with /airdrops and add your first drop location.

Start order matters. If this resource starts before ox_lib, config.lua never loads and you get three attempt to index a nil value (global 'Config') errors that point at the wrong files. The script now says so plainly instead.

Drop locations

There are none out of the box, on purpose. You build them in game, standing where you want crates to land — guessing coordinates in a text file and restarting to see where they went is a miserable way to design an event.

  1. Open /airdrops and go to Locations.
  2. Stand on the spot and press Add where I'm standing. The coordinates are captured for you.
  3. Give it a name and a weight. Weight is relative to the other locations, not a percentage.
  4. Press Test drop on the row. That runs a real drop only admins can see — no announcement, no player blip, no police call, and it is left out of the history.

Capture the spot on the ground, not on a roof or an embankment. The marker sits where you captured it and the crate rests on the ground below, so a spot grabbed from height puts the two in different places.

Pick open ground with more than one approach. A spot with a single road in belongs to whoever parks on it, which is not a contest.

Loot tables

Loot is rolled on the server at the moment a crate is cracked — never earlier, and never on a client. If the contents could be known before the fight, people would decide whether the fight was worth having.

Tiers hold items. Both carry a weight, and both are relative, so adding a tier does not mean rebalancing everything else. The panel shows the resolved percentage next to each weight, because "weight 28" means nothing on its own.

Guaranteeing something worth having

Guarantee at least names a tier. One roll is forced up to that tier or better, so a crate is never entirely bandages after a five-minute fight — which is the fastest way to teach players to ignore the next one.

Who takes part

Two separate questions, and they usually have different answers:

  • See — who is told a drop is happening and gets the blip
  • Collect — who can crack the crate and take from it

Police are handled separately because they are the usual exception. Setting Police can loot to off turns them into responders rather than another gang: they see every drop and turn up, but cannot take from it.

All of it is enforced on the server. The blip is only sent to players allowed to see it, and changing job mid-event drops the blip rather than leaving a stale one.

Timings

Every one of these is editable live from the panel. No restart.

  • Warning window — the gap between the announcement and the plane arriving. This is the window players travel in; too short and only whoever was already nearby can contest it.
  • Crack time — how long you stand exposed at the crate. This is the number that decides whether a drop is a contest or a footrace.
  • Give up after — how long an uncracked crate waits. Only counts down on an empty zone.
  • Hold it for — granted again each time the timer runs out with someone still there, so a crate outlives whoever is using it.
  • Gone regardless after — the cap on that, measured from landing, so nobody can camp one all night.
  • Empty crate stays for — an emptied crate lingers instead of vanishing on the last item, so late arrivals can see they missed it.

The admin panel

/airdrops, or right-click the command in your admin menu. Access is by ace permission (XS-CriminalTablet.airdrops), framework group, or a listed licence identifier.

  • Live Drop — what is running, a countdown, and start or cancel. Starting one offers a silent test.
  • Locations — add from where you stand, go to, test drop, enable or disable inline, delete all.
  • Loot Tables — tiers and items, with resolved percentages.
  • History — every drop, what was in it and who cracked it. The number worth watching is the abandon rate.
  • Settings — 49 settings across timings, area, loot, access, police, map, aircraft and notifications. Each field saves on its own.

Every callback re-checks permission on the server. The panel asking once before it opens is a convenience for whoever clicked, not the security boundary.

Before going live

  • Run a silent test drop on each location before enabling it. It is the whole reason that button exists.
  • Check the abandon rate in History after a few days. More than half untouched usually means drops are landing where nobody goes, the warning window is too short to travel in, or the loot is not worth the trip.
  • Decide early whether police can loot. It changes what a drop feels like more than any other setting.
  • This never touches PvP. Whether a fight over the crate is allowed is your server's rules, not this script's.

Troubleshooting

Nothing appears in the location dropdown

There are no enabled locations. Open the Locations tab and add one, or switch an existing one on. The script ships with none on purpose.

"You are not close enough to the crate"

The location was probably captured on top of something, so the crate is resting on the ground well below the marker. Re-capture it standing where you want the crate. Reach is also editable in Settings.

attempt to index a nil value (global 'Config')

config.lua did not load, which is almost always start order. ensure ox_lib and ensure oxmysql must come before ensure XS-AirDrops in your server.cfg.

The crate is empty when I open it

No enabled loot tier had any enabled items in it. Check the Loot Tables tab — a tier with no items is never rolled.

Drops never happen on their own

Either the scheduler is off, there are no enabled locations, or you are below the player minimum. All three are shown on the Live Drop tab.

Updating

  1. Keep a copy of your edited config.lua.
  2. Replace the resource folder and merge your config back.
  3. Re-run sql/airdrops.sql. It only creates what is missing.
  4. Restart the resource.

Anything you changed in the Settings tab lives in the database, not in config.lua, so it survives an update untouched.

Support

Open an issue on GitHub, or ask in the Discord.