cw.salesmenu classclient
Part of Salesmen
Defines the client-side cw.salesmenu library, which holds the data of the salesman whose trade menu is open.
The data arrives in the Salesmenu Cable message; the getters expose the salesman entity, its sells and buys
lists, stock, cash, prices and trade restrictions to the cwSalesmenu panel.
Summary
Methods
batch size).Methods
cw.salesmenu:BuyInShipments()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:20Returns whether the open salesman sells items in whole shipments (the item's batch size).
Returns
- Boolean Whether items are sold in shipments
cw.salesmenu:GetBuyRate()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:32Returns the percentage of an item's cost the open salesman pays when buying it.
Returns
- Number The buy rate, from 1 to 100
cw.salesmenu:GetBuys()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:74Returns the items the open salesman buys.
Returns
- Map Item unique IDs mapped to a price override, or
trueto use the item's cost
cw.salesmenu:GetCash()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:56Returns the cash the open salesman has to buy items with.
Returns
- Number The salesman's cash,
-1for unlimited
cw.salesmenu:GetClasses()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:38Returns the classes allowed to trade with the open salesman.
Returns
- Map Class names mapped to
true; empty for no restriction
cw.salesmenu:GetEntity()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:68Returns the salesman entity the trade menu was opened for.
Returns
- Entity The
cw_salesmanentity
cw.salesmenu:GetFactions()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:44Returns the factions allowed to trade with the open salesman.
Returns
- Map Faction names mapped to
true; empty for no restriction
cw.salesmenu:GetFlags()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:98Returns the flags required to trade with the open salesman.
Returns
- String The flags
cw.salesmenu:GetName()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:92Returns the name of the open salesman.
Returns
- String The salesman's name
cw.salesmenu:GetPanel()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:86Returns the salesman trade menu panel.
Returns
- Panel The
cwSalesmenupanel, ornilif it was never created
cw.salesmenu:GetPriceScale()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:26Returns the multiplier the open salesman applies to item costs when selling.
Returns
- Number The price scale,
1when unset
cw.salesmenu:GetSells()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:80Returns the items the open salesman sells.
Returns
- Map Item unique IDs mapped to a price override, or
trueto use the item's cost
cw.salesmenu:GetStock()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:50Returns the remaining stock of the open salesman.
Returns
- Map Item unique IDs mapped to the amount left; items without an entry are unlimited
cw.salesmenu:GetText()
client gamemodes/catwork/plugins/salesmen/plugin/libraries/cl_salesmenu.lua:62Returns the responses of the open salesman.
Returns
- Map Response names such as
startornoStockmapped toMaps withtext,soundandbHideName