The Vendor Tool. Left click on a vendor opens its editor; left click anywhere else places a new vendor there, facing the owner, with the model set in the tool's settings, and opens the editor for it. Right click removes the vendor the owner is looking at. Reload on a vendor picks it for moving, and reload anywhere else then moves it there. The tool requires the manage_vendors permission, which each of its actions checks as well.

Summary

Functions

Builds the tool's settings panel: the model that new vendors get.

Methods

Opens the editor of the vendor that was hit, or places a new vendor at the spot that was hit and opens the editor for it.
Picks the vendor that was hit for moving, or moves the vendor that was picked earlier to the spot that was hit, facing the owner.
Removes the vendor the tool owner is looking at.

Functions

TOOL.BuildCPanel(panel)

shared plugins/vendors/plugin/tools/sh_vendor.lua:119

Builds the tool's settings panel: the model that new vendors get.

Parameters

  • panel Panel the tool's control panel

Methods

TOOL:LeftClick(trace)

shared plugins/vendors/plugin/tools/sh_vendor.lua:31

Opens the editor of the vendor that was hit, or places a new vendor at the spot that was hit and opens the editor for it.

Parameters

  • trace Map trace result of the tool owner's aim

Returns

  • Boolean true if a vendor was placed or its editor opened (always true clientside), false if nothing was hit or the vendor could not be created, nil if the owner lacks the 'manage_vendors' permission

Picks the vendor that was hit for moving, or moves the vendor that was picked earlier to the spot that was hit, facing the owner.

Parameters

  • trace Map trace result of the tool owner's aim

Returns

  • Boolean true if a vendor was picked or moved (always true clientside), false if there is no vendor to move, nil if the owner lacks the 'manage_vendors' permission

TOOL:RightClick(trace)

shared plugins/vendors/plugin/tools/sh_vendor.lua:63

Removes the vendor the tool owner is looking at.

Parameters

  • trace Map trace result of the tool owner's aim

Returns

  • Boolean true if a vendor was removed (always true clientside), false if no vendor was hit, nil if the owner lacks the 'manage_vendors' permission

Defined in