So what the code below does is for humans only removes friendly fire completly
how ever bots still remain getting damaged by friendly fire any ideas?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Variable Friendly Fire"
#define AUTHOR "David"
#define VERSION "1.0"
new dmg_reduce;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
dmg_reduce = register_cvar("dmg_var", "0.0")
RegisterHam( Ham_TakeDamage , "player" , "PlayerHurt", 0);
}
public PlayerHurt( victim,inflictor,attacker,Float:damage, DamageBits )
{
if(is_user_alive(victim) && is_user_alive(attacker) && cs_get_user_team(victim, "", 0) == cs_get_user_team(attacker, "", 0))
{
SetHamParamFloat(4, damage * get_pcvar_float(dmg_reduce));
}
return HAM_IGNORED;
}