spectate check for player

This commit is contained in:
Lorenc Pekaj 2018-10-13 00:49:38 +11:00
parent 44f16fcc3d
commit 23fc8aa608

View File

@ -158,7 +158,7 @@ public OnPlayerFeedUpdate( playerid )
stock DamageFeedAddHitGiven( playerid, issuerid, Float: amount, weaponid ) stock DamageFeedAddHitGiven( playerid, issuerid, Float: amount, weaponid )
{ {
foreach( new i : Player ) if ( i != playerid ) { foreach( new i : Player ) if ( p_Spectating{ i } && p_whomSpectating[ i ] == issuerid && i != playerid ) {
AddDamageHit( g_damageGiven[ i ], i, issuerid, amount, weaponid ); AddDamageHit( g_damageGiven[ i ], i, issuerid, amount, weaponid );
} }
@ -167,7 +167,7 @@ stock DamageFeedAddHitGiven( playerid, issuerid, Float: amount, weaponid )
stock DamageFeedAddHitTaken( playerid, issuerid, Float: amount, weaponid ) stock DamageFeedAddHitTaken( playerid, issuerid, Float: amount, weaponid )
{ {
foreach( new i : Player ) if ( i != playerid ) { foreach( new i : Player ) if ( p_Spectating{ i } && p_whomSpectating[ i ] == issuerid && i != playerid ) {
AddDamageHit( g_damageTaken[ i ], i, issuerid, amount, weaponid ); AddDamageHit( g_damageTaken[ i ], i, issuerid, amount, weaponid );
} }