I would like when you shoot through the wall not to give you money
Code:
#include < amxmodx >
#include < hamsandwich>
#include < cstrike >
#include < biohazard >
new const PLUGIN_NAME[ ] = "[Bio] Damage Money (Chance)",
PLUGIN_VERSION[ ] = "1.0",
PLUGIN_AUTHOR[ ] = "Dias";
const CHANCE = 30;
public plugin_init( ) {
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
is_biomod_active( ) ? plugin_init2( ) : pause( "ad" );
}
public plugin_init2( ) {
RegisterHam(Ham_TakeDamage, "player", "fw_take_damage")
}
public fw_take_damage(victim, inflictor, attacker, Float:damage, damagebits)
{
if(!is_user_connected(victim) || !is_user_connected(attacker))
return HAM_IGNORED
if(is_user_zombie(attacker) || !is_user_zombie(victim))
return HAM_IGNORED
if(damage == 0.0)
return HAM_IGNORED
new Chance = random_num( 1, 100 );
if( Chance > 0 && Chance <= CHANCE ) {
cs_set_user_money( attacker, cs_get_user_money( attacker ) + floatround( damage ) );
} else {
return HAM_HANDLED;
}
return HAM_HANDLED
}