This should be in the Plugin Requests section...
Anyway.
Untested.
amx_reflect
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "Damage Reflector"
#define VERSION "1.0"
#define AUTHOR "Elusive"
#define ACCESSLEVEL ADMIN_SLAY
//Thanks Bugsy
//Example: SetPlayerBit( BitFieldVar , # )
#define SetPlayerBit(%1,%2) (%1 |= (1<<(%2&31)))
#define ClearPlayerBit(%1,%2) (%1 &= ~(1 <<(%2&31)))
#define CheckPlayerBit(%1,%2) (%1 & (1<<(%2&31)))
new gReflect, bool:gRoundEnd
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_reflect", "CmdToggleReflect", ACCESSLEVEL, "name or #userid")
RegisterHam(Ham_TakeDamage, "player", "FwdHamTakeDamage")
register_logevent("EventRoundStart", 2, "1=Round_Start")
register_logevent("EventRoundEnd", 2, "1=Round_End")
}
public CmdToggleReflect(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_CONTINUE
new args[32]
read_args(args, charsmax(args))
new target = cmd_target(id, args, CMDTARGET_ALLOW_SELF)
if (CheckPlayerBit(gReflect, target))
{
ClearPlayerBit(gReflect, target)
}
else
{
SetPlayerBit(gReflect, target)
}
return PLUGIN_HANDLED
}
public FwdHamTakeDamage(this, idinflictor, idattacker)
{
if (!gRoundEnd && CheckPlayerBit(gReflect, this))
{
SetHamParamEntity(1, idattacker)
SetHamParamEntity(3, this)
}
}
public EventRoundStart()
{
gRoundEnd = false
}
public EventRoundEnd()
{
gRoundEnd = true
}