CityRP Documentation Repository

Loadouts

Loadouts plugin, shared half. Describes each job's kit once, as slots. Spawn and the government locker grant from these descriptions (see sv_init.lua and sv_locker.lua); /resupply, arrest release and passive mode move onto them under epic #1930. The client reads them to draw the locker menu.

Functions

Servercityrp.getVehicleResupplyType(uniqueID) → stringSource ☍

Look up the resupply type a vehicle offers, if any. Networked on spawn so the client can tell whose hint to show on a gov vehicle.

Parameters

  • uniqueIDstringThe vehicle item's unique ID.

Returns

  1. stringThe resupply type, or an empty string when the vehicle has no locker.

Classes

SharedLoadoutAmmoSource ☍

Reserve ammo, as {ammoType, amount} pairs.

ServerLoadoutLockerRequestSource ☍

Picks per slot name, as locker option names. This is what EquipFromLocker takes.

ServerLoadoutModelRulesSource ☍

Model swaps, tried in order: a model ending in any of a rule's suffixes becomes its model.

LoadoutConditional

2 fields Source ☍

An item issued only while a condition holds.

SharedLoadoutConditional.classSource ☍

Weapon class.

SharedLoadoutConditional.whenSource ☍

Server-side check; the item is issued when it returns true.

LoadoutKit

7 fields Source ☍

Everything one job, or one pass, is issued.

SharedLoadoutKit.alwaysSource ☍

Weapon classes always issued.

SharedLoadoutKit.ammoSource ☍

Reserve ammo for the always items.

SharedLoadoutKit.attachmentsSource ☍

CW 2.0 attachments given to the player.

SharedLoadoutKit.conditionalSource ☍

Items issued only while their condition holds.

SharedLoadoutKit.lockerSource ☍

Department named on the locker menu. Only a kit with one may use the locker.

SharedLoadoutKit.lockerClipsSource ☍

Magazines of reserve ammo a locker option's class comes with.

SharedLoadoutKit.slotsSource ☍

Slots, keyed by a name from PLUGIN.slotOrder.

LoadoutOption

11 fields Source ☍

One thing the locker offers in a slot.

SharedLoadoutOption.accessSource ☍

Access flag the player needs to pick it.

SharedLoadoutOption.actionSource ☍

Key into the server's PLUGIN.lockerActions, run once the locker has granted.

SharedLoadoutOption.ammoSource ☍

Reserve ammo it sets, in place of the ammo worked out from its classes.

SharedLoadoutOption.classesSource ☍

Weapon classes it issues.

SharedLoadoutOption.clipsSource ☍

Magazines of reserve ammo per class, in place of the kit's lockerClips.

SharedLoadoutOption.costSource ☍

Price at the locker. Nothing is charged when the player would be issued every class it gives anyway.

SharedLoadoutOption.minRepSource ☍

REP the player needs to pick it.

SharedLoadoutOption.nameSource ☍

Label in the locker menu, unique within its slot. Picks name an option by it.

SharedLoadoutOption.noAmmoSource ☍

Its classes carry no reserve ammo.

SharedLoadoutOption.roundsSource ☍

Reserve rounds for its class, in place of the kit's lockerClips magazines.

SharedLoadoutOption.visibleArmourSource ☍

Shows the police model's heavy vest bodygroup.

LoadoutResolution

4 fields Source ☍

What a player's kit resolves to: the classes to give, in grant order, and what comes with them.

ServerLoadoutResolution.ammoSource ☍

Reserve ammo, summed per type, in the order each type first appears.

ServerLoadoutResolution.classesSource ☍

Kit classes, baseline excluded, each listed once.

ServerLoadoutResolution.passClassesSource ☍

The classes among classes that only the pass contributes.

ServerLoadoutResolution.pickedSource ☍

The locker options that were issued, in slot order.

LoadoutResupplyPoint

3 fields Source ☍

What a resupply point offers.

ServerLoadoutResupplyPoint.delaySource ☍

Seconds before the player may resupply again, in place of resupplyDelay.

ServerLoadoutResupplyPoint.msgSource ☍

The emote the player makes on resupplying.

ServerLoadoutResupplyPoint.typeSource ☍

A key of PLUGIN.resupplyRoles, or all.

LoadoutResupplyRole

2 fields Source ☍

One kind of resupply point: who may take from it, and what everyone else is told.

SharedLoadoutResupplyRole.allowedSource ☍
SharedLoadoutResupplyRole.refusalSource ☍

LoadoutSlot

5 fields Source ☍

One slot of a kit: a choice of item where the kit holds a fixed number.

SharedLoadoutSlot.accessSource ☍

Access flag the player needs for the default to be issued at all.

SharedLoadoutSlot.ammoSource ☍

Reserve ammo that comes with the default.

SharedLoadoutSlot.defaultSource ☍

The weapon class issued when the player has not picked another.

SharedLoadoutSlot.maxSource ☍

How many options the locker lets a player pick here. Defaults to 1.

SharedLoadoutSlot.optionsSource ☍

What the locker offers in place of the default.

LoadoutStash

3 fields Source ☍

A player's stash.

ServerLoadoutStash.causesSource ☍

What is keeping the equipment stashed, such as restraint or knockout.

ServerLoadoutStash.entriesSource ☍

Stashed issued weapons, keyed by class.

ServerLoadoutStash.restrainedSource ☍

Whether a restraint has been a cause since the stash was last emptied.