Buyzones usually touch all player spawns of an entire team.
Template:Base brush multi
In code, it is represented by theCBuyZone
class, defined in thefunc_buy_zone.cpp
file.
Entity Description
It is used to define areas where players of different teams can open the buy menu to purchase weapons and equipment.
If a player touches the volume of this entity and his team equals the team of this entity, then he is allowed to buy.
If this entity has the team 0 or -1, then any or no player can buy inside this entity's volume, respectively.
Tip: The SetTeam
input can be used to change the buying team in-game.
Note: Setting this entity's team to -1 and Disable
ing it have the same effect, just that these are independent operations.
Bug: The "touch-specific" I/O of this entity (OnStartTouch
, OnTouching
, ...) does not work properly, the buyzone's volume seems not to be considered. Make a different entity to use these. [todo tested in ?]
Bug:
By default, this entity has the inputs SetEnabled/SetDisabled
in Hammer, but it actually doesn't; Using these has no effect! Use Enable/Disable/Toggle
. This can be fixed by editing in csgo.fgd, searching for func_buyzone
. (That's 8 characters to delete.) [todo tested in ?]
Keyvalues
- Team number (int) (TeamNum) <integer>
- The team that can use the buyzone.
-1 |
No one
|
0 |
Everyone
|
2 |
Terrorists
|
3 |
Counter-Terrorists
|
other |
No one
|
Note: This keyvalue is only used when this entity is spawned, so changing it with AddOutput has no effect.
The actual keyvalue that determines the buy team is teamnumber
.
BaseTrigger
- Filter Name (filtername) <filter>
- A filter entity to test potential activators against.
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enable input).
|
Inputs
- SetTeam <integerRedirectInput/integer>
- Sets the team of this entity, which also sets the team that is allowed to buy.
- SetTeam_TerroristOnly (only in
)
- Restrict buyzone to Terrorists only. Equivalent to
SetTeam 2
.
- SetTeam_CTOnly (only in
)
- Restrict buyzone to Counter-Terrorists only. Equivalent to
SetTeam 3
.
- SetTeam_AllTeams (only in
)
- Allows all teams to use the buyzone. Equivalent to
SetTeam 0
.
- SetTeam_None (only in
)
- Allows no team to use the buyzone, effectively disabling it. Equivalent to
SetTeam -1
.
BaseTrigger
- Toggle
- Toggles this trigger between enabled and disabled states.
- Enable
- Enable trigger
- Disable
- Disable trigger
- TouchTest (in all games since
)
- Triggers either the OnTouching or OnNotTouching outputs for whether anything is touching this entity.
Bug:Sleeping prop_physics will never fire "OnTouching". Also applies to entities using prop_physics as base. (tested in: )
- StartTouch (in all games since
) !FGD
- Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
- EndTouch (in all games since
) !FGD
- Behave as if !caller had just exited the trigger volume.
- DisableAndEndTouch (only in
 )
- Disables this trigger and calls EndTouch on all currently-touching entities.
|
Outputs
BaseTrigger
- OnStartTouch
- !activator = entity that caused this output
!caller = this entity Fired when a valid entity starts touching this trigger.
- OnStartTouchAll
- !activator = entity that caused this output
!caller = this entity Fired when a valid entity starts touching this trigger, and no other entities are touching it. If there are any other entities touching the trigger when a new one begins to touch, only OnStartTouch will fire.
- OnEndTouch
- !activator = entity that caused this output
!caller = this entity Fired when a valid entity stops touching this trigger.
Note:Will also fire for entities touching it when trigger is disabled via Disable input
Warning:This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
Warning:OnEndTouch can fire before OnStartTouch under certain circumstances[How?] where both are fired on the same tick and each have the same delay. Fix:Add a slight delay to OnEndTouch .
- OnEndTouchAll
- !activator = entity that caused this output
!caller = this entity Fired when all valid entities stop touching this trigger.
- OnTouching (in all games since
)
- !activator = !caller = this entity
Fired if something is currently touching this trigger when TouchTest is fired.
- OnNotTouching (in all games since
)
- !activator = !caller = this entity
Fired if nothing is currently touching this trigger when TouchTest is fired.
|