Defines the Backpack storage item, which adds 8 to its carrier's inventory weight limit, is limited to one per player and drops as a boxed_backpack.

Summary

Methods

Always allows the backpack to be picked up.
Blocks taking the backpack from storage when its owner would be left over their weight limit or the player already carries a backpack.
Drops the backpack as a boxed_backpack item entity.
Blocks dropping the backpack, with a notification, when the player would be left over their weight limit.

Methods

ITEM:CanPickup(player, quickUse, itemEntity)

shared gamemodes/cwhl2rp/schema/items/sh_backpack.lua:40

Always allows the backpack to be picked up.

Parameters

  • player
  • quickUse
  • itemEntity

ITEM:CanTakeStorage(player, storageTable)

shared gamemodes/cwhl2rp/schema/items/sh_backpack.lua:21

Blocks taking the backpack from storage when its owner would be left over their weight limit or the player already carries a backpack.

Parameters

  • player
  • storageTable

ITEM:OnCreateDropEntity(player, position)

shared gamemodes/cwhl2rp/schema/items/sh_backpack.lua:15

Drops the backpack as a boxed_backpack item entity.

Parameters

  • player
  • position

Returns

  • Entity The spawned item entity

ITEM:OnDrop(player, position)

shared gamemodes/cwhl2rp/schema/items/sh_backpack.lua:45

Blocks dropping the backpack, with a notification, when the player would be left over their weight limit.

Parameters

  • player
  • position

Defined in