OnPlayerTakeDamage
#2

I forgot to account for armor. I posted code for it when someone pointed it out.

PHP код:
new 
    
playerArmor
    
amoun;  
     
GetPlayerArmour(playeridplayerArmor);  
if(
GetPlayerTeam(playerid) == PLAYER_STATE_ALIVE

    if(
playerArmor 0// if their armor is greater than 0 
    

        
amoun playerArmor amount// player's armor - amount of damage taken  
         
        
if(amoun <= 0// if armor - amount taken is less than or equal to 0  
            
SetPlayerHealth(playeridplayerHealth amount); // health is set 
             
        
else 
        { 
            if(
bodypart != BODY_PART_HEAD && bodypart != BODY_PART_RIGHT_LEG && bodypart != BODY_PART_LEFT_LEG
                
SetPlayerArmour(playeridamoun); // if the bodypart doesn't equal head, left/right leg, we'll set their armor down 
                 
            
else SetPlayerHealth(playeridplayerHealth amount); // else their armor is taken down 
        

    } 
    else 
SetPlayerHealth(playeridplayerHealth amount); 

http://forum.sa-mp.com/showpost.php?...3&postcount=59
Reply


Messages In This Thread
OnPlayerTakeDamage - by Cubie - 13.11.2017, 14:40
Re: OnPlayerTakeDamage - by Kane - 13.11.2017, 17:12
Re: OnPlayerTakeDamage - by aoky - 13.11.2017, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)