untested
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new bool:Masoquista[ 33 ]
new g_iMaxPlayers;
#define IsPlayer(%1) (1<=%1<=g_iMaxPlayers)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /maso" , "masoquista" )
g_iMaxPlayers = get_maxplayers();
RegisterHam( Ham_Spawn , "player" , "Fwd_PlayerSpawn_Post" , 1 )
RegisterHam( Ham_TakeDamage , "player" , "FwdTakeDamage" , 0 )
}
public masoquista(id)
{
Masoquista[id] = true;
}
public Fwd_PlayerSpawn_Post(id)
{
Masoquista[id] = false;
}
public FwdTakeDamage( victim , inflictor , attacker , Float:damage , damage_bits )
{
return ( IsPlayer( attacker ) && ( !Masoquista[ attacker ] || !Masoquista[ victim ] ) && ( get_user_team( victim ) == get_user_team( attacker ) ) ) ? HAM_SUPERCEDE : HAM_IGNORED;
}
__________________