1. Kovalev PWnz

    Kovalev PWnz Scavenger

    Code (Text):
    namespace Oxide.Plugins
    {
        [Info("TestPlugin", "TestPlugin", "1.0.0")]
        public class TestPlugin : RustPlugin {
            void CanAttack(BasePlayer player) {
                Puts("CanAttack works!");
            }
        }
    }
    This shit does not work
     
  2. Canopy Sheep

    Canopy Sheep Master Researcher Plugin Developer

  3. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    CanAttack should work fine, but not sure if all attack methods are covered with it. @Mughisi mentioned he'd look into it though.
     
  4. Canopy Sheep

    Canopy Sheep Master Researcher Plugin Developer

    I tested it recently, works with nothing. Haven't tried this recent update however.
     
  5. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Hmmm... might be that it got added to the Docs but not actually added. :p I know I had it with some changes, but it may have gotten stashed.
     
    Kovalev PWnz likes this.
  6. Kovalev PWnz

    Kovalev PWnz Scavenger

    OnPlayerAttack is called when Projectile reaches the target. It does not suit me

    OnWeaponFired is not called for melee.
    OnMeleeThrown works only for throwing
    CanAttack does not work at all

    I can not solve my task
     
  7. Mughisi

    Mughisi Grenade Master Community Mod Oxide Developer

    The method that the CanAttack hook is in is actually no longer being called by the game so a new location needs to be found.