This system "Health side" does not really work, if afk and pull it nothing happens
PHP код:
public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid, bodypart )
{
if( issuerid != INVALID_PLAYER_ID )
{
if( playerDeath[ issuerid ] == 0 )
{
new Float: HP, Float: AP, Float: totalhp;
GetPlayerHealthEx( playerid, HP );
GetPlayerArmourEx( playerid, AP );
printf("wadawda");
if ( AP >= amount )
{
SetPlayerArmourEx( playerid, AP - amount );
SetPlayerHealthEx( playerid, HP );
}
else if ( AP <= 0 )
{
totalhp = HP - amount;
SetPlayerHealthEx( playerid, totalhp );
if ( totalhp <= 0 && playerDeath[ playerid ] == 0 )
{
OnPlayerDeath( playerid, issuerid, weaponid );
playerDeath[ playerid ] = 1;
}
}
else
{
totalhp = HP + ( AP - amount );
SetPlayerArmourEx( playerid, 0.0 );
SetPlayerHealthEx( playerid, totalhp );
if ( totalhp <= 0 && playerDeath[ playerid ] == 0 )
{
OnPlayerDeath( playerid, issuerid, weaponid );
playerDeath[ playerid ] = 1;
}
}
}
}
return 1;
}