added callback to return the damage given/taken

This commit is contained in:
Steven Howard 2018-10-11 11:26:08 +01:00
parent 0405aa45a4
commit 71dc423e88

View File

@ -21,6 +21,7 @@
/* ** Forwards ** */
forward OnPlayerFeedUpdate( playerid );
forward OnPlayerTakenDamage( playerid, issuerid, Float: amount, weaponid, bodypart );
/* ** Variables ** */
enum E_DAMAGE_FEED
@ -54,6 +55,17 @@ hook OnPlayerConnect( playerid )
}
/* ** Functions ** */
public OnPlayerTakenDamageFeed( playerid, issuerid, Float: amount, weaponid, bodypart )
{
if ( issuerid != INVALID_PLAYER_ID )
{
AddDamageFeedHit( issuerid, playerid, amount, weaponid, TYPE_GIVEN );
}
AddDamageFeedHit( playerid, issuerid, amount, weaponid, TYPE_TAKEN );
return 1;
}
public OnPlayerFeedUpdate( playerid )
{
p_damageFeedTimer[ playerid ] = -1;