weapon damage help
#1

I am trying to find out something. I want to know how to make it that when i shoot a player with a gun it takes away x amount of health. I found out how to shoot someone and it set their health but I do not want it to set it, I want it to take away x amount of health.
Reply
#2

If you found out how to shoot someone and set their health then you have already answered your own question. Just set it to however much you want to take away?

pawn Код:
OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(    damagedid, HP   );
    SetPlayerHealth(    damagedid, HP -[amount you want to reduce by]   );
   
    return 1;
}
?
Reply
#3

Quote:
Originally Posted by PlayLSX_Founder
Посмотреть сообщение
If you found out how to shoot someone and set their health then you have already answered your own question. Just set it to however much you want to take away?

pawn Код:
OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(    damagedid, HP   );
    SetPlayerHealth(    damagedid, HP -[amount you want to reduce by]   );
   
    return 1;
}
?
pawn Код:
OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    SetPlayerHealth(playerid, HP -[amount you want to reduce by]);
    return 1;
}
And even with this code, it still might not function the way you want it, because of lagg etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)