1. Is there any hook called when a player is wounded?
     
  2. Wulf

    Wulf Community Admin

  3. I mean when you are wounded not when taking damage
     
  4. Wulf

    Wulf Community Admin

    If you just want to check if a player is wounded, you'd just need to find the check in Rust that stores that.
    [DOUBLEPOST=1439596049][/DOUBLEPOST]
    I'm not sure that's what the OP wants.
     
  5. the hook CanBeWounded just call the method when you start being wounded or return true when you are wounded?
    How does it works exactly?
     
  6. Wulf

    Wulf Community Admin

    • Called from BasePlayer.EligibleForWounding
    • Returning true or false will cancel default behavior
    • Called when a player dies
     
  7. So it is called only once when you start being wounded or when you die?
     
  8. Wulf

    Wulf Community Admin

    From that description, when you die. You can detect if a player is wounded by checking the player with Rust itself, likely a player flag.
     
  9. Too dificult for me since I dont know how rust works. I will try to find how does it works. Thanks
     
  10. Wulf

    Wulf Community Admin

    Code:
    player.IsWounded()
    Code:
    player:IsWounded()
    or

    Code:
    player.HasPlayerFlag(BasePlayer.PlayerFlags.Wounded)
    Code:
    player:HasPlayerFlag(BasePlayer.PlayerFlags.Wounded)
     
  11. Ok thanks a lot
     
  12. Sorry to dig up an old thread, but what properties does info have on canbewounded? Most specifically, what weapon was used and who did it...?

    Thanks in advance.


    T.
     
  13. Wulf

    Wulf Community Admin

    That's all under HitInfo.
     
  14. Hi Wulf, my question is *what* is the 'all' that is under HitInfo? :)

    On a separate note, I am using CanBeWounded to announce deaths, but I noticed the other day that when a user recovers from a near death experience, the event triggers regardless i.e. when a player is laying on the ground sobbing like a girl, CanBeWounded has already announce their death. Can it only be trusted for signifying the death of someones dignity?
     
  15. Wulf

    Wulf Community Admin

    You can see that under the Assembly-CSharp.dll for Rust using a decompiler such as JustDecompile. HitInfo is something Rust provides, not Oxide.

    CanBeWounded is not a good location for death announcements, that is triggered before they die most of the time. I'd suggest using OnPlayerDie instead.
     
  16. NOP

    NOP

    Does this still work? I am falling from a large height to try and trigger the "Wounded" message with the code below -- to no avail

    Code:
    void CanBeWounded(BasePlayer player, HitInfo info)
            {
                if (player.IsWounded() || player.HasPlayerFlag(BasePlayer.PlayerFlags.Wounded))
                {
                    Plugin.Puts("Wounded!");
                }
            }
     
  17. Wulf

    Wulf Community Admin

    Everything other than Plugin.Puts is right, it should just be Puts.
     
  18. NOP

    NOP

    Thanks for your response Wulf :)

    That's not the issue tho, because the Puts works ( When I print my player flags to console, I only ever see IsConnected and IsAsmin. Never Wounded, etc.) I wonder If another plugin is causing collisions......

    Edit: The only plugins I have which touch "CanBeWounded" is the KillFeed plugin, and it dosent seem like It would prevent my code from working? I even tried unloading all plugins that I thought might be colliding.....I think it must be something else....
     
    Last edited by a moderator: Jan 8, 2017
  19. Wulf

    Wulf Community Admin

    Considering that CanBeWounded happens before they are actually wounded, you'll likely never pass that check. If you want to check if a player is wounded, check when they take damage or in another hook location.