1. How would I detect what type of ammo ATTACKER used to killed VICTIM (ie HV, Explosive or Incendiary) using OnEntityDeath?

    I currently use

    Code:
    var weapon = info?.Weapon?.GetItem().info?.displayName?.english?.ToString()
    to get the Weapon Name.
     
    Last edited by a moderator: Oct 13, 2015
  2. Try this:
    Code:
    string ammoType = info?.Weapon?.GetItem().GetHeldEntity().primaryMagazine.ammoType?.displayName.english
     
  3. Thanks for your reply.

    When I add that line and try to compile it it says:

    Code:
    [Oxide] 2:12 PM [Error] Damage.cs(76,59): error CS1061: Type `BaseEntity' does n
    ot contain a definition for `primaryMagazine' and no extension method `primaryMa
    gazine' of type `BaseEntity' could be found. Are you missing an assembly referen
    ce?
    Line 56 is the code you sent me.
     
  4. Right. I forgot something. This working fine.
    Code:
    var weapon = info?.Weapon?.GetItem()?.GetHeldEntity() as BaseProjectile ?? null;
    if (!weapon) return;
    string ammoType = weapon.primaryMagazine.ammoType?.displayName.english ?? "Melee";
    
     
  5. That works, thank you very much!