CityRP Documentation Repository

cityrp.dupeitems

AdvDupe2 Inventory Item Validation. Gates AdvDupe2 pasting of inventory-placeable entities behind the same ownership/limit rules already enforced when a player places one normally.

Functions

Servercityrp.dupeitems.CheckSpawn(ply, class) → boolean, boolean?Source ☍

Checks whether a player may have this entity class pasted via AdvDupe2 - tracked items are gated by ownership/limit, blocked classes are denied outright, both bypassed only for admins with their "Ignore Entity Limits" F1 setting enabled. Only applies to an actual AdvDupe2 paste (AdvDupe2.SpawningEntity); Q-menu/other spawns of the same classes are left to the normal staff-only gate.

Parameters

  • plyPlayerThe pasting player.
  • classstringThe entity class AdvDupe2 wants to create.

Returns

  1. 1booleanWhether this class is governed by this system.
  2. 2boolean?Whether the paste may proceed, when handled.
Servercityrp.dupeitems:HandlePostPaste(ply)Source ☍

Registers a pasted item entity against the player's live placed-count, since a dupe paste never runs the item's own onUse.

Parameters

  • plyPlayerThe pasting player.
Servercityrp.dupeitems.IsPasteAllowlisted(ply, class, model) → booleanSource ☍

Whether a non-admin may paste this class via AdvDupe2, for classes IsTracked above doesn't cover - see PASTE_ALLOWLIST. Most entries are a flat true/false; some need the player and/or model too.

Parameters

  • plyPlayer
  • classstring
  • modelstring?

Returns

  1. boolean
Servercityrp.dupeitems.IsTracked(class) → booleanSource ☍

Whether this entity class is governed by this system in any way - keypad passthrough, a tracked inventory item, or blocked outright. AdvDupe2's own vendored IsAllowed (sv_clipboard.lua) defers to this instead of its own Spawnable/AdminOnly checks for any class this returns true for, so the entity files can carry accurate, standard Spawnable/AdminSpawnable flags without those flags controlling dupe-paste permission - this system's own tables are the single source of truth for that instead.

Parameters

  • classstring

Returns

  1. boolean

Fields

Servercityrp.dupeitemsSource ☍