void OnEntitySpawned(BaseHelicopter heli)
        {
            if (!configData.Alerts.PatrolHeli)
            {
                return;
            }
            if (heli == null)
            {
                return;
            }
            var    srcPos  = heli.transform.position;
            var    destPos = heli.GetComponentInParent <PatrolHelicopterAI>().destination;
            string msg     = Lang("PatrolHeli", null, GetLocation(srcPos, null, null), GetLocationDest(destPos));

            Server.Broadcast(msg);
            if (configData.Misc.LogToConsole)
            {
                Puts(msg);
            }
            if (configData.Misc.LogToFile)
            {
                LogToFile("log", $"[{DateTime.Now.ToString("HH:mm:ss")}] {msg}", this);
            }
        }
Example #2
0
        void OnEntitySpawned(BaseHelicopter heli)
        {
            if (!configData.alerts.patrolHeli)
            {
                return;
            }

            NextTick(() =>
            {
                if (heli == null)
                {
                    return;
                }

                SendMsg(Lang("PatrolHeli", null, GetLocation(heli.transform.position, null, null), GetLocationDest(heli.GetComponentInParent <PatrolHelicopterAI>().destination)));
            });
        }