Defines the containertool toolgun, an admin tool that fills a container with random items or sets its message, name or password.

Left click runs the mode picked in the tool's control panel on the container under the crosshair, doing what /ContFill, /ContSetMessage, /ContSetName and /ContSetPassword do. The tool is only registered when the Storage plugin is loaded and enabled.

Summary

Functions

Builds the tool's control panel: the mode list and the settings for the current mode.

Methods

Fills the container a trace hit with random items from the tool's fill category.
Runs the selected mode on the container the owner is looking at: fill, set message, name or password.
Sets the message of the prop a trace hit to the tool's contmessage setting.
Sets the name of the container a trace hit to the tool's contname setting.
Sets the password of the container a trace hit to the tool's contpassword setting.

Functions

Builds the tool's control panel: the mode list and the settings for the current mode.

Parameters

  • Panel Panel The tool's control panel

Methods

Fills the container a trace hit with random items from the tool's fill category.

Only works on props whose model is in cwStorage.containerList. cwStorage:FillContainer adds the items, with the contfillscale setting (1-5) as the scale. The owner is notified of the result. Does nothing on the client.

Parameters

  • entity Map The trace result whose Entity is the container

Returns

  • Boolean True on the client, otherwise nil

Runs the selected mode on the container the owner is looking at: fill, set message, name or password.

Admins only; filling is for superadmins only, like /ContFill.

Parameters

  • trace

Sets the message of the prop a trace hit to the tool's contmessage setting.

Stored in the entity's cwMessage field. Works on any physics prop; the owner is notified of the result. Does nothing on the client.

Parameters

  • entity Map The trace result whose Entity is the container

Returns

  • Boolean True on the client, otherwise nil

Sets the name of the container a trace hit to the tool's contname setting.

Only works on props whose model is in cwStorage.containerList; props without an inventory are made into storage first. The name is stored in the entity's Name networked string. Does nothing on the client.

Parameters

  • entity Map The trace result whose Entity is the container

Returns

  • Boolean True on the client, otherwise nil

Sets the password of the container a trace hit to the tool's contpassword setting.

Only works on props whose model is in cwStorage.containerList; props without an inventory are made into storage first. The password is stored in the entity's cwPassword field and shown to the owner. Does nothing on the client.

Parameters

  • entity Map The trace result whose Entity is the container

Returns

  • Boolean True on the client, otherwise nil

Defined in