mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Created a logic using flags to kick layers using the extended slot blocker from Ciribob
This commit is contained in:
parent
059754fc28
commit
fbabc54e03
@ -108,6 +108,8 @@ function AIRBASEPOLICE_BASE:New( SetClient, Airbases )
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, {}, 0, 2, 0.05 )
|
self.AirbaseMonitor = SCHEDULER:New( self, self._AirbaseMonitor, {}, 0, 2, 0.05 )
|
||||||
|
|
||||||
|
trigger.action.setUserFlag("SSB",100)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -183,20 +185,7 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
|
|||||||
else
|
else
|
||||||
MESSAGE:New( "Player " .. Client:GetPlayerName() .. " is being damaged at the airbase, due to a speeding violation ...", 10, "Airbase Police" ):ToAll()
|
MESSAGE:New( "Player " .. Client:GetPlayerName() .. " is being damaged at the airbase, due to a speeding violation ...", 10, "Airbase Police" ):ToAll()
|
||||||
--- @param Wrapper.Client#CLIENT Client
|
--- @param Wrapper.Client#CLIENT Client
|
||||||
local function DestroyUntilHeavilyDamaged( Client )
|
Client:Destroy()
|
||||||
local ClientCoord = Client:GetCoordinate()
|
|
||||||
ClientCoord:Explosion( 100 )
|
|
||||||
local Damage = Client:GetLife()
|
|
||||||
local InitialLife = Client:GetLife0()
|
|
||||||
MESSAGE:New( "Player " .. Client:GetPlayerName() .. " Damage ... " .. Damage, 5, "Airbase Police" ):ToAll()
|
|
||||||
if ( Damage / InitialLife ) * 100 < 80 then
|
|
||||||
Client:ScheduleStop( DestroyUntilHeavilyDamaged )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Client:ScheduleOnce( 1, DestroyUntilHeavilyDamaged, Client )
|
|
||||||
--Client:ScheduleRepeat( 1, 1, 0, nil, DestroyUntilHeavilyDamaged, Client )
|
|
||||||
--Client:Destroy()
|
|
||||||
trigger.action.setUserFlag( "AIRCRAFT_"..Client:GetID(), 100)
|
|
||||||
Client:SetState( self, "Speeding", false )
|
Client:SetState( self, "Speeding", false )
|
||||||
Client:SetState( self, "Warnings", 0 )
|
Client:SetState( self, "Warnings", 0 )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -79,7 +79,8 @@ function OBJECT:Destroy()
|
|||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
|
|
||||||
if DCSObject then
|
if DCSObject then
|
||||||
|
USERFLAG:New( self:GetGroup():GetName() ):Set( 100 )
|
||||||
|
--BASE:CreateEventCrash( timer.getTime(), DCSObject )
|
||||||
DCSObject:destroy()
|
DCSObject:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user