What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

TradePack getting status

PhB

New Member
Joined
Mar 9, 2015
Messages
2
Reaction score
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.
 
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;
}
 
Back
Top