Business

Controls the business system which allows players to purchase items

Functions

CanBuy(name)

View source »

Returns if a player can buy a buyable

Parameters

impulse.Business.Define(name, buyableData)

View source »

Renders a blur effect on a panel. Call this inside PANEL:Paint

Parameters

  • buyableData

    Buyable data

See Also

impulse.SpawnBuyable(pos, ang, buyable, owner)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Spawns a buyable as an entity

Parameters

  • pos vector

  • ang angle

  • owner entity

    Owner player

Tables

BuyableData

View source »

A collection of data that defines how a buyable will behave

Fields

  • entity string optional

    Entity class name

  • bench string optional

    Bench class name

  • description string

    Buyable description

  • price int

    Price

  • teams optional

    A table of teams that can buy this buyable

  • classes optional

    A table of classes that can buy this buyable

  • refund boolean default: false

    Should this buyable be refunded on server crashes

  • refundAdd int default: 0

    The amount to add to the price in the event of a refund being issued

  • removeOnTeamSwitch boolean default: false

    Should the buyable be removed on team switch

  • postSpawn function optional

    Called after the buyable is spawned (ent, ply) arguments passed

  • customCheck function optional

    Determines if the buyable can be spawned based on return value (ply) arguments passed