Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]-[no exports]-[getHp] #70

Open
Mesrine67 opened this issue Jan 26, 2024 · 4 comments
Open

[Bug]-[no exports]-[getHp] #70

Mesrine67 opened this issue Jan 26, 2024 · 4 comments
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@Mesrine67
Copy link

Summary

no exports getHp qbx_medical

Reproduction

me code used

CreateThread(function()
    while true do
        Wait(1000)
        local playerPed = PlayerPedId()
        local health = exports.qbx_medical:getHp()

        if health <= healthThreshold then
            for _, npc in ipairs(npcs) do
                if not IsPedDeadOrDying(npc, true) then
                    handlePlayerCapture(npc, playerPed)
                    break 
                end
            end
        end
    end
end)

Expected behavior

return health

Actual behavior

No such exports

Additional context

image

Current Version

1.0.0

Custom Resources

lsd-adminmenu (personnal resource no free)

@Mesrine67 Mesrine67 added bug Something isn't working need repro This bug report needs confirmation labels Jan 26, 2024
@qbox-duck qbox-duck bot added this to Issues Jan 26, 2024
@github-project-automation github-project-automation bot moved this to Todo in Issues Jan 26, 2024
@ghost
Copy link

ghost commented Jan 26, 2024

No need for an export when the native GetEntityHealth gets the players current health

@ghost
Copy link

ghost commented Jan 26, 2024

That function doesn't even exist, that's why you are getting the error, replace exports.qbx_medical:getHp() with GetEntityHealth(playerPed)

@Mesrine67
Copy link
Author

I know it doesn't exist, why I'm reporting a bug, exporting it and giving it in the documentation

https://docs.qbox.re/resources/qbx_medical/Functions/Client#gethp

@Manason
Copy link
Contributor

Manason commented Jan 26, 2024

No need for an export when the native GetEntityHealth gets the players current health

We have cases where the entities health is full, like when the player is "dead", but their virtual health is 0, no? That was the original thought behind tracking hp separately, but maybe it's better to just ask callers to check the death state in addition to the entity health.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Todo
Development

No branches or pull requests

2 participants