mirror of
https://github.com/ciribob/DCS-CSAR.git
synced 2025-10-29 16:56:07 +00:00
Update CSAR.lua
Csar on crash,. added config on top to activate / deactivate
This commit is contained in:
committed by
GitHub
parent
927625ad64
commit
cdc057086b
12
CSAR.lua
12
CSAR.lua
@@ -8,6 +8,8 @@
|
|||||||
-- 2 - Disable Aircraft for Pilot when he's shot down -- timeout to reenable pilot for aircraft
|
-- 2 - Disable Aircraft for Pilot when he's shot down -- timeout to reenable pilot for aircraft
|
||||||
-- 3 - Pilot Life Limit - No Aircraft Disabling
|
-- 3 - Pilot Life Limit - No Aircraft Disabling
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
csar = {}
|
csar = {}
|
||||||
|
|
||||||
-- SETTINGS FOR MISSION DESIGNER vvvvvvvvvvvvvvvvvv
|
-- SETTINGS FOR MISSION DESIGNER vvvvvvvvvvvvvvvvvv
|
||||||
@@ -140,6 +142,8 @@ csar.maxLives = 8 -- Maximum pilot lives
|
|||||||
|
|
||||||
csar.countCSARCrash = false -- If you set to true, pilot lives count for CSAR and CSAR aircraft will count.
|
csar.countCSARCrash = false -- If you set to true, pilot lives count for CSAR and CSAR aircraft will count.
|
||||||
|
|
||||||
|
csar.csarOncrash = true -- If set to true, will generate a csar when crash as well.
|
||||||
|
|
||||||
csar.reenableIfCSARCrashes = true -- If a CSAR heli crashes, the pilots are counted as rescued anyway. Set to false to Stop this
|
csar.reenableIfCSARCrashes = true -- If a CSAR heli crashes, the pilots are counted as rescued anyway. Set to false to Stop this
|
||||||
|
|
||||||
-- - I recommend you leave the option on below IF USING MODE 1 otherwise the
|
-- - I recommend you leave the option on below IF USING MODE 1 otherwise the
|
||||||
@@ -320,7 +324,7 @@ function csar.eventHandler:onEvent(_event)
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
--[[ elseif (_event.id == 9) then
|
elseif (_event.id == 9 and csar.csarOncrash == false) then
|
||||||
-- Pilot dead
|
-- Pilot dead
|
||||||
|
|
||||||
env.info("Event unit - Pilot Dead")
|
env.info("Event unit - Pilot Dead")
|
||||||
@@ -355,9 +359,11 @@ function csar.eventHandler:onEvent(_event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
]]
|
|
||||||
elseif _event.id == 9 or world.event.S_EVENT_EJECTION == _event.id then
|
|
||||||
|
|
||||||
|
elseif _event.id == 9 or world.event.S_EVENT_EJECTION == _event.id then
|
||||||
|
if _event.id == 9 and csar.csarOncrash == false then
|
||||||
|
return
|
||||||
|
end
|
||||||
env.info("Event unit - Pilot Ejected")
|
env.info("Event unit - Pilot Ejected")
|
||||||
|
|
||||||
local _unit = _event.initiator
|
local _unit = _event.initiator
|
||||||
|
|||||||
Reference in New Issue
Block a user