Setting Max Stamina

I am creating a Gang RP / 100K Or Die server so I am wanting to increase the max stamina so players can sprint longer but not wanting to provide them infinite stamina.

I see a lot of guides for infinite stamina but nothing for upping the stamina percentage.

It’s a percentage, IIRC 100 is “maximum”, set via this native:

I’m just unsure how I’d write this into a function! Could you possibly help with that?

Literally anywhere in a client script that runs when the player ped is created, nothing fancy to it

Oh of course but I am unsure what I would do with,

bool SET_PLAYER_STAMINA(Player playerId, float stamina);

as I’ve never altered a line like this.
Unsure where I’d write the increased percentage.

Because that’s not Lua, in that window on the top-left make sure to switch to a language you’re used to :smiley:

Dude… I must be blind :sweat_smile: :rofl:
Thank you.
Just got back into FiveM after a few years of not working with it… Was lost for a moment.

Is this Native Reference site a tad bit newer? I don’t remember ever seeing it 3-4 years ago.

image

So would this be correct? By the looks of it, this seems right but I am wondering if there’s more to it!
I am testing in-game but doesn’t seem to increase it

That’s not right at all lol, don’t copy the retval stuff etc - all you need to do is
SetPlayerStamina(PlayedPedId(), 100.0)
The .0 at the end is because it’s a float value type according to the reference

EDIT: IDK what the actual max value is, 100.0 is off the top of my head - best try a few lol

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.