Hello people,
good'm trying to create it not give double damage on certain weapons
I'm doing this:
PHP Code:
new bool:g_Enabled[33];
#define NO_DAMAGE (1<<2 | 1<<CSW_KNIFE | 1<<CSW_HEGRENADE)
PHP Code:
RegisterHam ( Ham_TakeDamage, "player", "fw_TakeDamage" );
PHP Code:
public fw_TakeDamage ( victim, inflictor, attacker, Float:damage) {
if ( ! ( g_Enabled[attacker] == true ) )
return PLUGIN_HANDLED;
new Weapon[20];
for ( new i =CSW_P228; i <=CSW_P90; i++ ) {
if ( ! ( NO_DAMAGE & (1<<i)) && get_weaponname(i, Weapon, charsmax(Weapon))) {
if ( is_user_connected ( attacker ) && is_user_alive ( attacker ) ) {
SetHamParamFloat ( 4, damage * 2 );
}
}
}
return PLUGIN_CONTINUE;
}
he is running fine except that it does not removing the double damage of the weapons defined in NO_DAMAGE,
could someone help me?
Sorry for English