• Visit Rebornbuddy
  • TradePack getting status

    Discussion in 'Archives' started by PhB, May 19, 2015.

    1. PhB

      PhB New Member

      Joined:
      Mar 9, 2015
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      How can I check if me/other is carrying a tradepack ?

      Currently I'm trying with:
      foreach (var item = player.getAllEquipedItems().Where(x => ((x.cell == 26) && (x.place == ItemPlace.Equiped) && isTradePack(x.id)))))
      {
      ...
      }

      - (x.cell == 26) instead of (equipCell == EquipItemPlace.Backpack) because latter doesn't seems to work
      - isTradePack(), custom function with id lookup table.

      Problem:
      - works when carrying a tradepack but stills returns a valid item when trade is put on the ground.
      - If targeted player disconnect then reconnect, information is accurate.
      - If tradepack is equiped again, foreach() returns 2 entries for same entity.
       
    2. DerpProgrammer

      DerpProgrammer Community Developer

      Joined:
      Mar 16, 2015
      Messages:
      33
      Likes Received:
      0
      Trophy Points:
      0
      I just wrote this code literally 5 minutes ago for a plugin that I'm about to publish that assists you with placing trade packs down. You're welcome to use it:

      if (HasTradePack())
      {
      //You have a trade pack
      }

      public bool HasTradePack()
      {
      List<Buff> BuffList = me.getBuffs();
      foreach (Buff debuff in BuffList){
      if (debuff.id==(1454)){
      return true;
      }
      }
      Log("You don't have a Trade Pack equipped!");
      return false;
      }
       
    3. PhB

      PhB New Member

      Joined:
      Mar 9, 2015
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      Thx! Will definitly give it a try.
       

    Share This Page