Jump to content

Recommended Posts

Posted (edited)

How to handle world.event.S_EVENT_MISSION_END?

I want send "STOPPED" word exactly when mission stops.

 

I add this code to my file-scripts

 

if ( world.event.S_EVENT_MISSION_END == true ) then

socket.try(StatUDP:send(string.format("STOPPED")))

end

 

File-scripts calls 1 time per second.

But when mission stops, nothing in my UDP-connection.

UDP-connection tested and works.

 

Is there are way to catch this event with "interrupt" style?

Edited by BR=55=Sevas
Posted

I'm not sure your if statement works with event handlers. I've always used something like the following...

 

function eventHandler(event)

if event.id == world.event.S_EVENT_SHOT then

end

end

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Thanks, Grimes!

But with function also no works.

I suppose this event impossible to handle. All scripts calls 1 time per second, but mission can stop anytime between second.

I didnt find any interrupt style call of events.

So, I have to back to export.lua

  • Recently Browsing   0 members

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