#include <sourcemod>
public Plugin myinfo =
{
name = "Blue Screen of Kill",
author = "johnspade",
description = "The plugin fades the screen to transparent blue for a second when you kill someone",
version = "1.0",
url = "johnspade.ru"
}
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
PerformFade(client, duration, const color[4])
{
Handle hFadeClient = StartMessageOne("Fade", client)
BfWriteShort(hFadeClient, duration)
BfWriteShort(hFadeClient, 0)
BfWriteShort(hFadeClient, (0x0001))
BfWriteByte(hFadeClient, color[0])
BfWriteByte(hFadeClient, color[1])
BfWriteByte(hFadeClient, color[2])
BfWriteByte(hFadeClient, color[3])
EndMessage()
}
public void Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
int attacker_id = GetEventInt(event, "attacker");
int attacker = GetClientOfUserId(attacker_id);
PerformFade(attacker, 300, (GetClientTeam(client) == 2) ? {255, 0, 0, 51} : {0, 0, 200, 51});
}