Quote:
Originally Posted by FailerZ
PHP Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER)
{
if(hitid != INVALID_PLAYER_ID)
{
new Float:hp;
GetPlayerHealth(hitid, hp);
if(hp <= 5.0 && GetPlayerWeapon(playerid) == WEAPON_DEAGLE) return 0; //Return 0 means the one who got shot (hitid) is not going to take damage
//Change the hp as you wish it but that's how i understand what you said
}
}
return 1;
}
|
That's basically it, but you should have leave it to him since its that simple. Anyway the only thing now he has to account for weapon damage. If for example player has 29hp and gets 30 damage he will still die. I guess these will come in handy
https://sampforum.blast.hk/showthread.php?tid=563387