How to take less damage using OnPlayerTakeDamage?
#1

Hello everyone I have this script

pawn Код:
if ( issuerid != INVALID_PLAYER_ID || issuerid == INVALID_PLAYER_ID )
    {
        //xxxxxxxxxxxxxxxxxxxxxxxxxx
        {
            if ( amount > 2 )
            {
                new Float:playerHp;
                GetPlayerHealth( playerid, playerHp );
                SetPlayerHealth( playerid, playerHp + ( amount*15/100 ) ); // give back 15% of the health..
            }
        }
    }
But when I take a damage my HP is reset back to 100. Why?
Reply
#2

try this
Код:
if ( issuerid != INVALID_PLAYER_ID || issuerid == INVALID_PLAYER_ID )
    {
        //xxxxxxxxxxxxxxxxxxxxxxxxxx
        {
            if ( amount > 2 )
            {
                new Float:playerHp;
                GetPlayerHealth( playerid, playerHp );
                SetPlayerHealth( playerid, playerHp - ( amount*15/100 ) ); // give back 15% of the health..
            }
        }
    }
Reply
#3

Thank you but it didn't work, how can I make so you only take 75% of the health instead of the full damage? i need this urgently
Reply
#4

Bump
Reply
#5

Код:
if ( issuerid != INVALID_PLAYER_ID || issuerid == INVALID_PLAYER_ID )
    {
        //xxxxxxxxxxxxxxxxxxxxxxxxxx
        {
            if ( amount > 2 )
            {
                new Float:playerHp;
                GetPlayerHealth( playerid, playerHp );
                SetPlayerHealth( playerid, playerHp - ( amount/100 *75) ); 
            }
        }
    }
Reply
#6

it kills me.. What can I do to effectively take only 75% of the damage?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)