OnPlayerTakeDamage
#1

I'm having some issues with my OnPlayerTakeDamage when being shot it only takes away the health and it completely ignores the Armour. Thanks for the help in advance.
Its from this script btw: https://sampforum.blast.hk/showthread.php?tid=641235

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        new
            
Float:health
        
;
        
        
PlayerInfo[playerid][pLastDamagetime] = gettime();
        
GetPlayerHealth(playeridhealth); 
        
        if(
GetPlayerTeam(playerid) != PLAYER_STATE_ALIVE && PlayerInfo[playerid][pDeathFix])
            
SetPlayerHealth(playeridhealth); 
        
        if(
GetPlayerTeam(playerid) == PLAYER_STATE_ALIVE)
        {
            
SetPlayerHealth(playeridhealth amount); 
            
CallbackDamages(playeridissueridbodypartweaponidamount); 
        }
        
        if(
health amount <= 4)
        {
            if(
GetPlayerTeam(playerid) == PLAYER_STATE_ALIVE)
            {
                if(
IsPlayerInAnyVehicle(playerid))
                    
ClearAnimations(playerid); 
                
                
CallLocalFunction("OnPlayerWounded""iii"playeridissueridweaponid); 
                return 
0;
            }
            
            return 
0;
        }
        
        if(
GetPlayerTeam(playerid) == PLAYER_STATE_WOUNDED)
        {
            if(!
PlayerInfo[playerid][pDeathFix])
            {                
                
CallLocalFunction("OnPlayerDead""iiii"playeridissueridweaponid1);
                return 
0;
            }
            
            return 
0;
        }
        
        if(
GetPlayerTeam(playerid) != PLAYER_STATE_ALIVE)
        {
            
SetPlayerHealth(playeridhealth);
            return 
0;
        }
    }
    return 
1;

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)