-- Advanced  Tools for Mission Editor
local thisModule
local moduleName = "Module4"

local function onTimer(events)
	for _id, _ in events:pairs() do
		if events:isCoreEvent(_id) == true then
			if events:getCoreEventType(_id) == "SIGNAL_UNIT_IN_ZONE" then
				local datas = events:getCoreEventDatas(_id)
				datas.unit:display("Vous entrez dans la zone", 5)
			end
		end
	end
end

local function onCreateGroup(_group)
	if _group:getName() == "rescue1" or _group:getName() == "rescue2" then
		_group:setPickupZone("ZonePickup1", 1)
		_group:setSignal(2500, "SIGNAL_SMOKE RED")
	end
end



-- MAIN
do
	local newHandlers = {
		onCreatePlayerHandler = nil,
		onDeletePlayerHandler = nil,
		onUpdatePlayerHandler = nil,
		onTakeoffPlayerHandler = nil,
		onLandingPlayerHandler = nil,
		onStartEnginePlayerHandler = nil,
		onStopEnginePlayerHandler = nil,
		
		onCreateAIUnitHandler = nil,
		onDeleteAIUnitHandler = nil,
		onDisableAIUnitHandler = nil,
		onTakeoffAIUnitHandler = nil,
		onLandingAIUnitHandler = nil,
		onStartEngineAIUnitHandler = nil,
		onStopEngineAIUnitHandler = nil,
		
		onCreateGroupHandler = onCreateGroup,
		onDeleteGroupHandler = nil,
		onDisableGroupHandler = nil,
		
		onCreateStaticObjectHandler = nil,
		onDeleteStaticObjectHandler = nil,
	
		onTimerHandler = onTimer,
		onModuleStartHandler = nil,
	}
		
	thisModule = ATME.C_Module(moduleName, newHandlers, true)
end