Skip to content

isPedDead client-side bug #4147

@gh0st2k2

Description

@gh0st2k2

Describe the bug

Calling this function with onClientPlayerWasted will return false (ped is not dead) if you die by falling (client-side), However on server-side, calling it with onPlayerWasted will return true (ped is dead) if you also die for the same reason.

This bug happens only if you die by falling as far as I know but, if you delay the call to isPedDead function when onClientPlayerWasted, it returns true (player is dead)

It happens even for the localPlayer who is always considered as a streamed-in GTA SA entity.

Steps to reproduce

-- client (no call delay)
addEventHandler("onClientPlayerWasted", root, 
function()
      -- player dies due to falling (localPlayer included)
      iprint(isPedDead(source))
      -- returns false (ped not dead but he triggered the onClientPlayerWasted event?)
end)


-- client (with call delay)
addEventHandler("onClientPlayerWasted", root, 
function()
      -- player dies due to falling (localPlayer included)
      local player = source
      setTimer(
           function() iprint(isPedDead(player)) end
      100, 1)
      -- sometines 50ms of delay still causes it to out put false
      -- returns true (ped is dead)
end)


-- server
addEventHandler("onPlayerWasted", root, 
function()
      -- player dies due to falling.
      iprint(isPedDead(source))
      -- returns true (ped is dead)
end)

Version

Latest version (not nightly)

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