cityrp.item

CityRP Item Library

Functions

cityrp.item.addCat(name, description, access)

View source »

Add a new category.

Parameters

  • name string

    The name of the category to add.

  • description string

    The description of the category. Defaults to an empty string.

  • access string

    The access for the category, defaults to 'b'.

Returns

  • number

    The category index.

cityrp.item.drop(ply, uid, amount)

View source »

Make a player drop an item.

Parameters

  • ply Player

    Player using the item.

  • uid string

    Unique ID of the item being dropped.

  • amount int

    The number of items being dropped.

Returns

  • bool

    If the drop was allowed.

cityrp.item.findCat(name)

View source »

Retrieve a category.

Parameters

  • name string

    Name of the category to find.

Returns

cityrp.item.get(name)

View source »

Get an item by its name.

Parameters

  • name string

    The name or unique ID of the item to get.

Returns

  • table

    The item table, or nil if not found.

cityrp.item.give(ply, uid, amount, target)

View source »

Transfer an item between players.

Parameters

  • ply Player

    Player giving the item.

  • uid string

    Unique ID of the item being given.

  • amount int

    The number of items being given.

Returns

  • bool

    If the give was allowed.

cityrp.item.new(base)

View source »

Create a new item based on the given base uniqueID.

Parameters

  • base string optional

    Base Item UniqueID

Returns

  • ITEM

    Newly created item.

cityrp.item.register(item, base)

View source »

Register a new item.

Parameters

  • item tab

    The item table to register.

  • base string optional

    The uniqueID of the base item to take properties from.

cityrp.item.remove(ply, uid)

View source »

Remove an item from a player (like a hat).

Parameters

  • ply Player

    The player to remove the item from.

Returns

  • bool

    Success.

cityrp.item.use(ply, uid)

View source »

Make a player use an item.

Parameters

  • ply Player

    Player using the item.

  • uid string

    Unique ID of the item being used.

Returns

  • bool

    If the use was allowed.