Facocero Posted February 13, 2022 Posted February 13, 2022 Good morning and good Sunday to everyone. I need your valuable advice on this event. I'm rehearsing to learn something. Simple things for many, but obviously not for me. Based on the advice received in other posts, I have this script helicopter = Unit.getByName('Mdmax') Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_CRASH and event.initiator == helicopeter then trigger.action.outText('crashed to the ground. ',10, true) end end world.addEventHandler(Handler) I ask two things: 1.) Is it possible to display the name of the pilot next to the text "" crashed to the ground ""? example. MdMax crashed to the ground ?? 2.) in the presence of many helicopters, identify which one, possibly crashed ??
toutenglisse Posted February 13, 2022 Posted February 13, 2022 1 hour ago, Facocero said: ...I ask two things: 1.) Is it possible to display the name of the pilot next to the text "" crashed to the ground ""? example. MdMax crashed to the ground ?? 2.) in the presence of many helicopters, identify which one, possibly crashed ?? Hi, with this addition to your script, it will do it for any helicopter that crashed : Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_CRASH and event.initiator:getDesc()["category"] == 1 then trigger.action.outText(event.initiator:getName() .. ' crashed to the ground. ',10, true) end end world.addEventHandler(Handler) 1
Facocero Posted February 13, 2022 Author Posted February 13, 2022 thank you toutenglisse I will definitely try-
Recommended Posts