Disabling damange once reaching a certain amount
#8

Quote:
Originally Posted by FailerZ
View Post
PHP Code:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
hittype == BULLET_HIT_TYPE_PLAYER)
    {
        if(
hitid != INVALID_PLAYER_ID)
        {
            new 
Float:hp;
            
GetPlayerHealth(hitidhp);
            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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)