Skip to content

[1.7] onPlayerWasted not triggering properly #4482

@ArranTuna

Description

@ArranTuna

Describe the bug

I slapped myself 100 HP with admin panel and noticed I didn't respawn. Turns out killPed works, but setElementHealth(me, 0) doesn't trigger onPlayerWasted:

[CIT]Arran executed command: addEventHandler("onPlayerWasted", root, function() outputChatBox("a") end)
Command results: true [boolean]
[CIT]Arran executed command: killPed(me)
a
Command results: true [boolean]
[CIT]Arran executed command: setElementHealth(me, 0)
Command results: true [boolean]

Could be relevant but I noticed that you can do setElementHealth(me, 100) and it brings you back and returns true, but if you do that after killPed it does nothing and returns false.

Steps to reproduce

Newest 1.7 nightly
srun addEventHandler("onPlayerWasted", root, function() outputChatBox("a") end)
srun setElementHealth(me, 0)

Version

v1.7-untested-25596

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions