Defines the Suitcase item (cw_suitcase), a fake melee weapon held in the hand whose Unpack option replaces it with a random piece of clothing, food and drink.

Summary

Methods

Shows the suitcase attachment only while the player has the suitcase weapon out.
Unpacks the suitcase into a random set of clothes, food and drink when Unpack is chosen, then removes it.
Lets the item be dropped; nothing else happens.

Methods

ITEM:GetAttachmentVisible(player, entity)

shared gamemodes/cwhl2rp/schema/items/sh_suitcase.lua:27

Shows the suitcase attachment only while the player has the suitcase weapon out.

Parameters

  • player Player The player wearing the attachment
  • entity Entity The cw_gear attachment entity

Returns

  • Boolean Whether the attachment is drawn

ITEM:OnCustomFunction(player, name)

server gamemodes/cwhl2rp/schema/items/sh_suitcase.lua:36

Unpacks the suitcase into a random set of clothes, food and drink when Unpack is chosen, then removes it.

Parameters

  • player
  • name

ITEM:OnDrop(player, position)

shared gamemodes/cwhl2rp/schema/items/sh_suitcase.lua:32

Lets the item be dropped; nothing else happens.

Parameters

  • player
  • position

Defined in