Exemplo n.º 1
0
        private void HandleEntity(BaseEntity baseEntity)
        {
            if (baseEntity == null)
            {
                return;
            }

            EventType eventType = GetEventTypeFromEntity(baseEntity);

            if (eventType == EventType.None)
            {
                PrintError("HandleEntity: eventType == EventType.None ->" + baseEntity.ShortPrefabName);
                return;
            }

            var eventSettengs = GetEventSettings(eventType);

            if (eventSettengs == null)
            {
                PrintError("HandleEntity: eventSettengs == null");
                return;
            }

            if (eventSettengs.Enabled)
            {
                if (_configData.GlobalSettings.LoggingEnabled)
                {
                    Puts(eventType.ToString());
                }

                if (eventType == EventType.Helicopter)
                {
                    if (PersonalHeli != null && PersonalHeli.IsLoaded)
                    {
                        if (PersonalHeli.Call <bool>("IsPersonal", baseEntity))
                        {
                            if (_configData.GlobalSettings.LoggingEnabled)
                            {
                                Puts("Personal Helicopter spawned at " + GetGridPosition(baseEntity.transform.position));
                            }

                            SendMessage(Lang("PersonalHelicopter", null, GetGridPosition(baseEntity.transform.position)), eventSettengs.WebhookURL);
                            return;
                        }
                    }
                }

                SendMessage(Lang(eventType.ToString(), null, GetGridPosition(baseEntity.transform.position)), eventSettengs.WebhookURL);
            }
        }
Exemplo n.º 2
0
 public void Init(PersonalHeli plugin, BasePlayer player)
 {
     Player = player;
     Plugin = plugin;
     OnInitChild();
 }