En:OnPutItem
Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.
Содержание |
[править]
Syntax
function OnPutItem(unit_name : String, object_name : String, item_name : String, take_all : Boolean) : Boolean
[править]
Description
Called when unit with name <unit_name> puts item with name <item_name> in his inventory. Item was taken from inventory of object with name <object_name>.
[править]
Parameters
- unit_name - string. Unit name who puts item to his inventory;
- object_name - string. Object name which was taken item;
- item_name - string. Item name from inventory with name object_name
- take_all - boolean. Value is true if unit with name <unit_name> takes all item;
[править]
Result
The function returns :
- true - action can be done;
- false - action can't be done.
Data type - Boolean
[править]
Example
function OnPutItem(unit_name, subj_name, item_name, take_all)
if ((subj_name == "roma") And (unit_name == "hero")) then
Randomize();
if Mod(Rand(), 5) == 0 then
return false;
endIf
endIf
return true; // Unit with name "unit_name" can put item with name
// "item_name"
endfunction
[править]