Game money: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Fix up the page)
Line 7: Line 7:
{{KV Targetname}}
{{KV Targetname}}
{{ScrollBox|title=game_money|}}
{{ScrollBox|title=game_money|}}
{{KV|Amount of money to add|int|Amount of money to add or deduct.}}
{{KV|Amount of money to add|int|intn=Money|Amount of money to add or deduct.}}
{{note|Do not add '''+''' or '''-''' , to add or deduct money use inputs.}}
{{KV|Award Text|string|intn=AwardText|The text that will print in the chat next to the award amount. Will look like this: '+/-1000: <Award Text>'}}
{{KV|Award Text|string|The text that will print in the chat next to the award amount. Will look like this: '+/-1000: <Award Text>'}}


== Inputs ==  
== Inputs ==  
{{ScrollBox|title=Base|}}
{{I Targetname}}
{{IO|FireUser1|to=FireUser4|Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].}}
{{ScrollBox|title=game_money|}}
{{ScrollBox|title=game_money|}}
{{IO|SetMoneyAmount|Set the money value that will be awarded. (without awarding it)}}
{{IO|SetMoneyAmount|param=int|Set the money value that will be awarded.}}
{{IO|AddTeamMoneyTerrorist|Add money to players on team TERRORIST.}}
{{Bug|[[FGD]] doesn't let you input a value, use [[AddOutput]] instead.}}
{{IO|AddTeamMoneyCT|Add money to players on team COUNTER TERRORIST.}}
{{IO|AddTeamMoneyTerrorist|Award money to Terrorists.}}
{{IO|AddMoneyPlayer|Add money directly to the player activating this entity. (doesn't print in chat)}}
{{IO|AddTeamMoneyCT|Award money to Counter-Terrorists.}}
{{IO|SpendMoneyFromPlayer|If the player has [money amount] or more, take [money amount] away.}}
{{IO|AddMoneyPlayer|Add money directly to the player activating this entity. (Doesn't print in chat)}}
{{IO|SpendMoneyFromPlayer|param=int|If the player has [money amount] or more, take [money amount] away.}}


== Outputs ==  
== Outputs ==  
{{O BaseEntity}}
{{O Targetname}}
{{ScrollBox|title=game_money|}}
{{ScrollBox|title=game_money|}}
{{IO|OnMoneySpent|Fires when input SpendMoneyFromPlayer succeeded.}}
{{IO|OnMoneySpent|Fires when input SpendMoneyFromPlayer succeeded.}}
{{IO|OnMoneySpentFail|Fires when input SpendMoneyFromPlayer failed. (Player didn't have enough money)}}
{{IO|OnMoneySpentFail|Fires when input SpendMoneyFromPlayer failed. (Player didn't have enough money)}}

Revision as of 12:13, 2 May 2021

game_money is a point entity available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

Entity description

An entity that can add or deduct money from players or teams.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

game_money:
Amount of money to add (Money) <integer>
Amount of money to add or deduct.
Award Text (AwardText) <string>
The text that will print in the chat next to the award amount. Will look like this: '+/-1000: <Award Text>'

Inputs

game_money:
SetMoneyAmount <integerRedirectInput/integer>
Set the money value that will be awarded.
Icon-Bug.pngBug:FGD doesn't let you input a value, use AddOutput instead.  [todo tested in ?]
AddTeamMoneyTerrorist
Award money to Terrorists.
AddTeamMoneyCT
Award money to Counter-Terrorists.
AddMoneyPlayer
Add money directly to the player activating this entity. (Doesn't print in chat)
SpendMoneyFromPlayer <integerRedirectInput/integer>
If the player has [money amount] or more, take [money amount] away.

Outputs

game_money:
OnMoneySpent
Fires when input SpendMoneyFromPlayer succeeded.
OnMoneySpentFail
Fires when input SpendMoneyFromPlayer failed. (Player didn't have enough money)