Added new Scheduler events to BASE.

This commit is contained in:
FlightControl_Master
2017-09-28 11:04:45 +02:00
parent 5558c26db7
commit 5641d65f71
2 changed files with 100 additions and 3 deletions

View File

@@ -181,8 +181,21 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
Client:Message( "You are speeding on the taxiway! Slow down or you will be removed from this airbase! Your current velocity is " .. string.format( "%2.0f km/h", Velocity ), 5, "Warning " .. SpeedingWarnings .. " / 3" )
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
else
MESSAGE:New( "Player " .. Client:GetPlayerName() .. " has been removed from the airbase, due to a speeding violation ...", 10, "Airbase Police" ):ToAll()
Client:Destroy()
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
local function DestroyUntilHeavilyDamaged( Client )
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, "Warnings", 0 )