CityRP Documentation Repository

ITEM.Card

The card collectable base.

Registration ID
base_card
Inherits
ITEM → ITEM.Collectable → ITEM.Card

Functions

SharedITEM:AutoBuild() → ITEMSource ☍

Automatically set name, descripition, category and unique ID.

Returns

  1. ITEM
SharedITEM:AutoCategory() → ITEMSource ☍

Automatically set the item's category.

Returns

  1. ITEM
SharedITEM:AutoDescription() → ITEMSource ☍

Automatically set the item's description from foil status, item / series title and collectable type.

Returns

  1. ITEM
SharedITEM:AutoID() → ITEMSource ☍

Automatically set the item's unique ID

Returns

  1. ITEM
SharedITEM:AutoName() → ITEMSource ☍

Automatically set the item name from foil status, item / series title and collectable type.

Returns

  1. ITEM
SharedITEM:AutoRegister() → boolean|nilSource ☍

Build and register a collectable automatically.

Returns

  1. boolean|nil
SharedITEM:BuildCard() → boolean|nilSource ☍

Build and register a collectable automatically. See: AutoRegister

Returns

  1. boolean|nil
SharedITEM:BuildSticker() → boolean|nilSource ☍

Build and register a collectable automatically. See: AutoRegister

Returns

  1. boolean|nil
SharedITEM:FindLookup(lookup, id, name) → string?Source ☍

Finds the name of an ID in a look up table. Sets the name if provided.

Parameters

  • lookuptableLookup Table.
  • idstringID to get/set.
  • namestring?Name to set.

Returns

  1. string?/stored name.
SharedITEM:New(series, name, foil) → ITEM.CollectableSource ☍

Create a new card. Overrides ITEM:New with a different signature; subclasses of this base that override it again must declare their own @class for the override to take, or they inherit this signature instead.

Parameters

  • series(string|table)?Either the series id, or {series id, series title}.
  • name(string|table)?Either the name id, or {name id, name title}.
  • foilboolean?If the card is a foil.

Returns

  1. ITEM.CollectableThe new collectable.
SharedITEM:onDestroy(ply)Source ☍

onDestroy hook/override for this item base.

Parameters

SharedITEM:onDrop(ply, pos)Source ☍

onDrop hook/override for this item base.

Parameters

SharedITEM:onGive(ply, to, amt)Source ☍

onGive hook/override for this item base.

Parameters

SharedITEM:SetCollectable(id, name) → ITEMSource ☍

Set the collectable type of this item.

Parameters

  • idstringCollectable ID.
  • namestring?Collectable Title.

Returns

  1. ITEM
SharedITEM:SetItem(id, name) → ITEMSource ☍

Set the name in series of this item.

Parameters

  • idstringItem / Name ID.
  • namestring?Title.

Returns

  1. ITEM
SharedITEM:SetLookup(lookup, id, name) → ITEMSource ☍

Set a lookup'd class on the item.

Parameters

  • lookupstringClass to set.
  • idstringID to get/set.
  • namestring?Name to set.

Returns

  1. ITEM
SharedITEM:SetSeries(id, name) → ITEMSource ☍

Set the series of this item.

Parameters

  • idstringSeries ID.
  • namestring?Series Title.

Returns

  1. ITEM

Fields

SharedITEM.SetFoilSource ☍

Sets if the collectable is a foil.

SharedITEM.uniqueIDSource ☍