#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#pragma tabsize 0
#pragma newdecls required
#define PLUGIN_VERSION "1.2"
int flash_client;
public Plugin myinfo =
{
version = PLUGIN_VERSION,
};
public void OnPluginStart()
{
HookEvent("flashbang_detonate", flashbang_detonate);
HookEvent("player_blind", player_blind);
}
public void flashbang_detonate(Event event, const char[] name, bool silent)
{
flash_client = GetClientOfUserId(GetEventInt(event, "userid"));
}
public void player_blind(Event event, const char[] name, bool silent)
{
CreateTimer(0.01, TIMER_player_blind, GetEventInt(event, "userid"));
}
public Action TIMER_player_blind(Handle timer, any client)
{
if (flash_client == client && IsClientInGame(client) && !IsPlayerAlive(client) && GetClientTeam(client) == 1)
{
SetEntPropFloat(client, Prop_Send, "m_flFlashDuration", 0.0);
SetEntPropFloat(client, Prop_Send, "m_flFlashMaxAlpha", 0.0);
ClientCommand(client, "dsp_player 0.0");
}
return Plugin_Stop;
}