PHP Code:
#include <sourcemod>
public Plugin myinfo =
{
name = "Blue Screen On Kill",
author = "Addicted [smol edit by Cruze]",
version = "1.2",
url = "oaaron.com"
};
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public Action Event_PlayerDeath(Event ev, const char[] name, bool dbc)
{
int victim = GetClientOfUserId(ev.GetInt("userid"));
if(victim < 1 || victim > MaxClients || IsFakeClient(victim))
return Plugin_Continue;
ShowScreenFade(victim, 211, 211, 211, 100); // Your preffered grey color code here
return Plugin_Continue;
}
void ShowScreenFade(int client, int r, int g, b, int a)
{
int duration = 200, holdtime = 200, flags = (0x0001 | 0x0010), color[4];
color[0] = r;
color[1] = g;
color[2] = b;
color[3] = a;
int clients[2];
clients[0] = client;
Handle message = StartMessageEx(GetUserMessageId("Fade"), clients, 1);
if (GetUserMessageType() == UM_Protobuf)
{
Protobuf pb = UserMessageToProtobuf(message);
pb.SetInt("duration", duration);
pb.SetInt("hold_time", holdtime);
pb.SetInt("flags", flags);
pb.SetColor("clr", color);
}
else
{
BfWriteShort(message, duration);
BfWriteShort(message, holdtime);
BfWriteShort(message, flags);
BfWriteByte(message, color[0]);
BfWriteByte(message, color[1]);
BfWriteByte(message, color[2]);
BfWriteByte(message, color[3]);
}
EndMessage();
}
__________________