Skip to content

Event onVehicleDamage doesn't trigger if vehicle health is above ~2050 #5019

Description

@guibzo

Describe the bug

Apparently, this event is not triggered when vehicle has above a certain amount of health.

Steps to reproduce

addCommandHandler("spawncar", function(player)
  local x, y, z = getElementPosition(player)

  local car = createVehicle(400, x, y, z, 0, 0, 0)

  setElementHealth(car, 3000)

  addEventHandler("onVehicleDamage", car, function(loss)
    iprint("loss", loss, "health", getElementHealth(source))
    -- this only starts printing on about ~2050 health
  end)
end)
Image

Version

v1.6-release-24124

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions