mirror of
https://github.com/weyne85/DML.git
synced 2025-10-29 16:57:49 +00:00
Initial commit
This commit is contained in:
36
modules/parashoo.lua
Normal file
36
modules/parashoo.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
parashoo = {}
|
||||
parashoo.version = "1.1.0"
|
||||
--[[--
|
||||
VERSION HISTORY
|
||||
- 1.0.0 initial version
|
||||
- 1.1.0 wait 3 minutes before destroying para
|
||||
guy, else KIA reported when player still
|
||||
in pilot
|
||||
|
||||
--]]--
|
||||
parashoo.killDelay = 3 * 60 -- 3 minutes delay
|
||||
|
||||
function parashoo.removeGuy(args)
|
||||
local theGuy = args.theGuy
|
||||
if theGuy and theGuy:isExist() then
|
||||
Unit.destroy(theGuy)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- remove parachuted pilots after landing
|
||||
function parashoo:onEvent(event)
|
||||
if event.id == 31 then -- landing_after_eject
|
||||
if event.initiator then
|
||||
|
||||
local args = {}
|
||||
args.theGuy = event.initiator
|
||||
timer.scheduleFunction(parashoo.removeGuy, args, timer.getTime() + parashoo.killDelay)
|
||||
--Unit.destroy(event.initiator) -- old direct remove
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- add event handler
|
||||
world.addEventHandler(parashoo)
|
||||
trigger.action.outText("parashoo v" .. parashoo.version .. " loaded.", 30)
|
||||
Reference in New Issue
Block a user