This commit is contained in:
Applevangelist 2023-01-10 07:48:13 +01:00
parent 5dd48cbd23
commit 581b5b3de9

View File

@ -100,7 +100,7 @@ PSEUDOATC.id="PseudoATC | "
--- PSEUDOATC version. --- PSEUDOATC version.
-- @field #number version -- @field #number version
PSEUDOATC.version="0.9.3" PSEUDOATC.version="0.9.4"
----------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------
@ -450,14 +450,18 @@ function PSEUDOATC:PlayerLanded(unit, place)
local group=unit:GetGroup() local group=unit:GetGroup()
local GID=group:GetID() local GID=group:GetID()
local UID=unit:GetDCSObject():getID() local UID=unit:GetDCSObject():getID()
local PlayerName=self.group[GID].player[UID].playername --local PlayerName=self.group[GID].player[UID].playername
local UnitName=self.group[GID].player[UID].unitname --local UnitName=self.group[GID].player[UID].unitname
local GroupName=self.group[GID].player[UID].groupname --local GroupName=self.group[GID].player[UID].groupname
local PlayerName = unit:GetPlayerName() or "Ghost"
-- Debug message. local UnitName = unit:GetName() or "Ghostplane"
local text=string.format("Player %s in unit %s of group %s (id=%d) landed at %s.", PlayerName, UnitName, GroupName, GID, place) local GroupName = group:GetName() or "Ghostgroup"
self:T(PSEUDOATC.id..text) if self.Debug then
MESSAGE:New(text, 30):ToAllIf(self.Debug) -- Debug message.
local text=string.format("Player %s in unit %s of group %s landed at %s.", PlayerName, UnitName, GroupName, place)
self:T(PSEUDOATC.id..text)
MESSAGE:New(text, 30):ToAllIf(self.Debug)
end
-- Stop altitude reporting timer if its activated. -- Stop altitude reporting timer if its activated.
self:AltitudeTimerStop(GID,UID) self:AltitudeTimerStop(GID,UID)
@ -479,18 +483,22 @@ function PSEUDOATC:PlayerTakeOff(unit, place)
-- Gather some information. -- Gather some information.
local group=unit:GetGroup() local group=unit:GetGroup()
local GID=group:GetID() --local GID=group:GetID()
local UID=unit:GetDCSObject():getID() --local UID=unit:GetDCSObject():getID()
local PlayerName=self.group[GID].player[UID].playername --local PlayerName=self.group[GID].player[UID].playername
local CallSign=self.group[GID].player[UID].callsign --local CallSign=self.group[GID].player[UID].callsign
local UnitName=self.group[GID].player[UID].unitname --local UnitName=self.group[GID].player[UID].unitname
local GroupName=self.group[GID].player[UID].groupname --local GroupName=self.group[GID].player[UID].groupname
local PlayerName = unit:GetPlayerName() or "Ghost"
-- Debug message. local UnitName = unit:GetName() or "Ghostplane"
local text=string.format("Player %s in unit %s of group %s (id=%d) took off at %s.", PlayerName, UnitName, GroupName, GID, place) local GroupName = group:GetName() or "Ghostgroup"
self:T(PSEUDOATC.id..text) local CallSign = unit:GetCallsign() or "Ghost11"
MESSAGE:New(text, 30):ToAllIf(self.Debug) if self.Debug then
-- Debug message.
local text=string.format("Player %s in unit %s of group %s took off at %s.", PlayerName, UnitName, GroupName, place)
self:T(PSEUDOATC.id..text)
MESSAGE:New(text, 30):ToAllIf(self.Debug)
end
-- Bye-Bye message. -- Bye-Bye message.
if place and self.chatty then if place and self.chatty then
local text=string.format("%s, %s, you are airborne. Have a safe trip!", place, CallSign) local text=string.format("%s, %s, you are airborne. Have a safe trip!", place, CallSign)