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

Execution of GetPlayerStamina failed #2341

Closed
Raikjo opened this issue Jan 14, 2024 · 8 comments
Closed

Execution of GetPlayerStamina failed #2341

Raikjo opened this issue Jan 14, 2024 · 8 comments
Labels

Comments

@Raikjo
Copy link

Raikjo commented Jan 14, 2024

What happened?

It is currently not possible to retrieve the Native GetPlayer Stamina.
I noticed this with a gym script, but the Hud also no longer displays the stamina correctly

Screenshot_62

Expected result

to get the Stamina of a player

Reproduction steps

Use the GetPlayerStamina Native in any Function

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

FiveM 3095 / windows Server 7310 and lower

Additional information

No response

@Raikjo Raikjo added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 14, 2024
@ng4software
Copy link

Hi,

The following code works perfectly fine on my end.
Perhaps you can also try running this code, my suspicion is that the argument you are passing in, is nil.
Thus making the native call fail.

Code used:

Citizen.CreateThread(function() 
    while true do
        print(GetPlayerStamina(PlayerId()))
        Citizen.Wait(0)
    end
end)

Server was using 7310 and Client used game build 2944.

@Raikjo
Copy link
Author

Raikjo commented Jan 14, 2024

The result of this query is "0.0" everytime
At the Moment i can slow Run endless Times, because there is no Stamina

But my game build is also 3095

@ng4software
Copy link

ng4software commented Jan 14, 2024

Ah yes, on client build 3095 I do also get the error:

[     50656] [b3095_GTAProce]             MainThrd/ __Lua_InvokeNative: execution failed: Error executing native 0x00000000e415ec5c at address extra-natives-five.dll+626A6.
[     50656] [b3095_GTAProce]             MainThrd/ ^1SCRIPT ERROR: Execution of native 00000000e415ec5c in script host failed: Error executing native 0x00000000e415ec5c at address extra-natives-five.dll+626A6.^7
[     50656] [b3095_GTAProce]             MainThrd/ ^3> GetPlayerStamina^7 (^5GetPlayerStamina.lua^7:6)
[     50656] [b3095_GTAProce]             MainThrd/ ^3> fn^7 (^5@test/client.lua^7:3)

Seems like something about it has regressed in this game build.
This is the exact same code as before, which worked in 2944.

@Disquse
Copy link
Contributor

Disquse commented Jan 14, 2024

Can you guys try canary (latest/unstable) update channel? I've (hopefully) fixed this issue in this commit 7a62907

@ng4software
Copy link

Can you guys try canary (latest/unstable) update channel? I've (hopefully) fixed this issue in this commit 7a62907

Yep, it does work in Canary.

@Disquse
Copy link
Contributor

Disquse commented Jan 14, 2024

Then, we will have to wait until it's merged into the production 😄

@gottfriedleibniz
Copy link
Contributor

I believe we have waited long enough.

@github-actions github-actions bot removed the triage Needs a preliminary assessment to determine the urgency and required action label Feb 1, 2024
@Disquse
Copy link
Contributor

Disquse commented Feb 1, 2024

@gottfriedleibniz yeah, seems to be working good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants