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

See also

Predefined procedures and functions (events)

Личные инструменты