CityRP Documentation Repository

cityrp_govlocker

Government locker entity, client half: the equipment menu, built from the player's kit in the loadouts plugin and the prices the server sends with it.

Functions

ServerENT:AcceptInput(inputName, activator)Source ☍

Opens the locker menu for a player who uses it, with what each option costs them.

Parameters

  • inputNamestring
  • activatorEntity
ServerENT:CanEquip(ply) → booleanSource ☍

Whether a player is in a state to use this locker at all: alive, free and within reach.

Parameters

Returns

  1. boolean
ClientENT:DrawHalo(alpha)Source ☍

Outlines the locker for a player who can equip from it.

Parameters

  • alphanumber
SharedENT:GetLockerKit(ply) → LoadoutKit?Source ☍

The kit a player equips from this locker with, or nil when their job has none.

Parameters

Returns

  1. LoadoutKit?
ClientENT:ListOptions(kit, prices) → GovLockerEntry[]Source ☍

Lists a kit's locker options in the order the server priced them.

Parameters

Returns

  1. GovLockerEntry[]
ClientENT:LockerMenu(kit, prices, rep, hasModelOverride)Source ☍

Opens this locker's equipment menu for the player's department. is set for the player's team -- the Uniform column is dropped in that case, since none of its options' model swaps should be allowed to override the mandated default model.

Parameters

  • kitLoadoutKitThe kit the player equips with; kit.locker names the department.
  • pricesnumber[]What each option costs the player, in ListOptions order.
  • repnumberThe player's REP, gating options that carry a minRep.
  • hasModelOverrideboolean?True if an Assistant+ job default model (core/plugins/teamname)
ServerENT:ReadPicks(kit, slotOrder) → table<string, string[]>?Source ☍

Reads the picks a player sent from the menu, as {slot index, option index} pairs, into the option names EquipFromLocker takes.

Parameters

Returns

  1. table<string, string[]>?Nil when a pair names nothing the kit offers.

Fields

SharedENT.AdminSpawnableSource ☍
SharedENT.LoadoutsSource ☍

The loadouts plugin, which owns this entity. Held here because the loader clears its PLUGIN global once the entity has registered.

GovLockerEntry

5 fields Source ☍

One option as the menu lists it.

ClientGovLockerEntry.optionSource ☍

One thing the locker offers in a slot.

ClientGovLockerEntry.optionIndexSource ☍

The option's position in its slot.

ClientGovLockerEntry.priceSource ☍

What the server says it costs this player.

ClientGovLockerEntry.slotIndexSource ☍

The slot's position in the plugin's slotOrder.

ClientGovLockerEntry.slotNameSource ☍