How can I make that a player can recieve damage and make damage to teammates, I mean like only that player have friendly fire on?
Example:
Player A and B are terrorists
Player A say /hitme
By typing /hitme individual friendly fire is enabled on player A
Player B can damage player A, and viceversa.
Ive tried with this, but it isnt working:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new Masoquista[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /maso", "masoquista")
RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
RegisterHam(Ham_TakeDamage, "player", "FwdTakeDamage", 0)
}
public masoquista(id)
{
if(get_user_team(id) == 1)
Masoquista[id] = 1
}
public Fwd_PlayerSpawn_Post(id)
{
Masoquista[id] = 0
}
public FwdTakeDamage(victim, inflictor, attacker, Float:damage, damage_bits)
{
if(!Masoquista[attacker] && Masoquista[victim])
{
new Float:Health
pev(victim, pev_health, Health)
set_pev(victim, pev_health, Health - damage)
}
}
__________________