Sign in to follow this  
Jaimuzu

How to stop playing losing hp when running for too long

Recommended Posts

This occurs due to player stamina hitting zero, resulting in hp being lost. Below is the workaround for this in both C# and JavaScript.

C#

//Subscribe the Tick event
Events.Tick += Tick;

public void Tick(List<Events.TickNametagData> nametags)
{
    RAGE.Game.Player.RestorePlayerStamina(1.0F);
}

JavaScript

mp.events.add('render', () => {
    mp.game.player.restoreStamina(100);
});

 

Edited by Jaimuzu
added event subscription
  • Like 3
  • Mask 1
  • Sad 1

Share this post


Link to post
Share on other sites
1 minute ago, ragempdev said:

ohhhh ty! got my stamina 💪 restored 😎 😏

epic )))))) may you run far and fast for eternity

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, amahone said:

Usefull, thx
I added statement

if(mp.players.local.isSprinting())
{
	mp.game.player.restoreStamina(100);
}

 

epic. glad you like men))))💙💙💙💙💙

  • Like 3

Share this post


Link to post
Share on other sites
8 hours ago, trolovecro said:

Didnt even know about that lol. Thanks!

😀😀😀😀😀😀😀😀😀😀😀 youre welcome on ragemp

  • Like 2

Share this post


Link to post
Share on other sites
vor 18 Stunden schrieb Outernet Roleplay:

You'll need to place it in a clientside file.

ya had that twice already and did not worked but found myself why and solved it, thanks for the respone o/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.