En:OnHeroAnswer
Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.
Содержание |
[править]
Syntax
function OnHeroAnswer(unit_name : String, answer_id : Number) : Boolean
[править]
Description
Called when unit talks with unit with name <unit_name> and selects answer with identifier <answer_id>;
[править]
Parameters
- unit_name - string. Unit name with who talks hero (user);
- answer_id - number. Answer identifier which user selects
[править]
Result
The function returns :
- true - is necessary to process data from event OnUnitTalk;
- false - leave answer and not process its over event OnUnitTalk.
Data type - Boolean.
[править]
Example
function OnHeroAnswer(unit_name, answer_id)
var hero;
var bot = CreateObject("MapObject");
if unit_name == "roma" then
if answer_id == 101 then
bot.SetCurrentTalkID(110);
return true;
endif
if (answer_id == 103) or (answer_id == 114) then
bot.Free();
ExitTalk(); // Exit from talking window
return false;
endif
endif
bot.Free();
ExitTalk();
return false;
endfunction
[править]