// Copyright © 2016 Vaqtincha
/* wopox1337 modification: (mod1)
- flash partly when teammate's flashes;
- And when don't partly.
*/
#include <amxmodx>
#include <reapi>
enum { BLINDED_PARTLY = 200, BLINDED_FULLY = 255 };
public plugin_init()
{
register_plugin("[ReAPI] No Team Flash lite", "0.0.2 (mod1)", "Vaqtincha");
RegisterHookChain(RG_PlayerBlind, "PlayerBlind", .post = false);
}
public PlayerBlind(const index, const inflictor, const attacker, const Float:fadeTime, const Float:fadeHold, const alpha, Float:color[3])
{
// Дебаг информация.
// client_print(index, print_chat, "fadeTime(%.1f),fadeHold(%.1f) ,alpha(%d)", fadeTime, fadeHold, alpha);
if(index != attacker
&& (get_member(index, m_iTeam) == get_member(attacker, m_iTeam))
&& alpha > BLINDED_PARTLY
&& !rg_is_user_blinded(index)
)
{
SetHookChainArg(6, ATYPE_INTEGER, BLINDED_PARTLY);
}
}
stock bool: rg_is_user_blinded(const pPlayerId)
return bool:(Float:get_member(pPlayerId, m_blindStartTime) + Float:get_member(pPlayerId, m_blindFadeTime) >= get_gametime())