Jump to content

Recommended Posts

Posted

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 ??

Posted
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)

 

  • Thanks 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...