#include < amxmodx > #include < hamsandwich > #include < basebuilder > #include < fun > new Float:fClientDamage[ 33 ]; public plugin_init( ) { RegisterHam( Ham_TakeDamage, "player", "OnTakeDamage", 1 ); } public client_putinserver( iClient ) { fClientDamage[ iClient ] = 0.0; } public OnTakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage, biDamage ) { if( !IsPlayer( iAttacker ) || !IsPlayer( iVictim ) ) // Both must be players return HAM_IGNORED; if( !is_user_alive( iAttacker ) ) // Only alive return HAM_IGNORED; if( bb_is_user_zombie( iAttacker ) ) // Skip zombies return HAM_IGNORED; fClientDamage[ iAttacker ] += fDamage; // Add damage (AFTER ALREADY CALCULATED BY ENGINE) if( fClientDamage[ iAttacker ] >= 250.0 ) // If damage is higher than the value you want { fClientDamage[ iAttacker ] = 0.0; set_user_armor( iAttacker, get_user_armor( iAttacker ) + 1 ); } return HAM_IGNORED; } stock IsPlayer( iEnt ) { if( iEnt >= 1 && iEnt <= 32 ) return true; return false; }