En:OnExchange
Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.
Содержание |
[править]
Syntax
function OnExchange(unit_name : String, in_hero_value : Number, in_unit_value : Number) : Boolean
[править]
Description
Called when units make exchange of inventory items.
[править]
Parameters
- unit_name - string - Unit name;
- in_hero_value - number - General goods cost of hero;
- in_unit_value - number - General goods cost of unit;
[править]
Result
The function returns :
- true - action can be done
- false - action can't be done
Data type - Boolean
[править]
Example
function OnExchange(unitName, inHeroValue, inUnitValue) var result = (inHeroValue >= inUnitValue); if result then AddStringMessageByIndex(1001); else AddStringMessageByIndex(1002); endIf return result; endfunction
[править]