Solved Return type in hooks

Discussion in 'Rust Development' started by JohnyBro, Feb 5, 2016.

  1. Hi guys,

    I started to create my own plugin but when I read the doc for the "OnPlayerAttack" hook it say that :
    • Called from BasePlayer.SharedProjectileAttack and BaseMelee.DoAttackShared
    • Useful for modifying an attack before it goes out
    • hitInfo.HitEntity should be the entity that this attack would hit
    • Returning true cancels the attack
    But it's a void method, why ?
     
  2. Wulf

    Wulf Community Admin

    I'ts not a void, the example is most likely wrong. You can use it as a void if you don't need to cancel anything though.
     
  3. I can put what I want instead of void ?
     
  4. Wulf

    Wulf Community Admin

    I believe you can use object there.
     
  5. Ok thx