1. How can I get the BasePlayer object from an event that doesnt have it? like
    OnHelicopterAttacked
     
  2. I dont really think that helicopter can attack someone(CH47), its scientists

    Looked up in CH47HelicopterAIController
    Code:
    public override void MounteeTookDamage(BasePlayer mountee, HitInfo info)
    {
      this.InitiateAnger();
    }
    Code:
    public void InitiateAnger()
      {
        // ISSUE: method pointer
        this.CancelInvoke(new Action((object) this, __methodptr(UnHostile)));
        // ISSUE: method pointer
        this.Invoke(new Action((object) this, __methodptr(UnHostile)), 120f);
        foreach (BaseVehicle.MountPointInfo mountPoint in this.mountPoints)
        {
          if ((UnityEngine.Object) mountPoint.mountable != (UnityEngine.Object) null)
          {
            BasePlayer mounted = mountPoint.mountable.GetMounted();
            if ((bool) ((UnityEngine.Object) mounted))
            {
              NPCPlayerApex npcPlayerApex = mounted as NPCPlayerApex;
              if ((bool) ((UnityEngine.Object) npcPlayerApex))
              {
                npcPlayerApex.Stats.Hostility = 1f;
                npcPlayerApex.Stats.Defensiveness = 1f;
              }
            }
          }
        }
      }
    
     

    Attached Files:

    Last edited by a moderator: Jul 19, 2018
  3. Yeah but players can attack the heli,I want to get the heli attacker.
     
  4. Code:
    object OnHelicopterAttacked(CH47HelicopterAIController heli)
    {
        var attacker = heli.lastAttacker;  //(BaseEntity)
        var attackerplayer = attacker.ToPlayer(); // If you want get player, dont forget check NRE
     
        return null;
    }
    [DOUBLEPOST=1531983425][/DOUBLEPOST]you also can get
    Code:
    heli.LastAttackedDir //(Vector 3)
    heli.lastAttackedTime //(float)