mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-25 04:25:26 +00:00
Reduced to 3 speed warnings and fixed km/h calculation error.
This commit is contained in:
@@ -158,7 +158,8 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local VelocityVec3 = Client:GetVelocity()
|
local VelocityVec3 = Client:GetVelocity()
|
||||||
local Velocity = math.abs(VelocityVec3.x) + math.abs(VelocityVec3.y) + math.abs(VelocityVec3.z)
|
local Velocity = math.abs(VelocityVec3.x) + math.abs(VelocityVec3.y) + math.abs(VelocityVec3.z) -- in meters / sec
|
||||||
|
local Velocity = Velocity * 3.6 -- now it is in km/h.
|
||||||
local IsAboveRunway = Client:IsAboveRunway()
|
local IsAboveRunway = Client:IsAboveRunway()
|
||||||
local IsOnGround = Client:InAir() == false
|
local IsOnGround = Client:InAir() == false
|
||||||
self:T( IsAboveRunway, IsOnGround )
|
self:T( IsAboveRunway, IsOnGround )
|
||||||
@@ -172,7 +173,7 @@ function AIRBASEPOLICE_BASE:_AirbaseMonitor()
|
|||||||
local SpeedingWarnings = Client:GetState( self, "Warnings" )
|
local SpeedingWarnings = Client:GetState( self, "Warnings" )
|
||||||
self:T( SpeedingWarnings )
|
self:T( SpeedingWarnings )
|
||||||
|
|
||||||
if SpeedingWarnings <= 5 then
|
if SpeedingWarnings <= 3 then
|
||||||
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 .. " / 5" )
|
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 .. " / 5" )
|
||||||
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
|
Client:SetState( self, "Warnings", SpeedingWarnings + 1 )
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user