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.2",
url = "http://johnspade.ru"
}
new iDuration, iColor[4];
public OnPluginStart()
{
decl String:f[5];
GetGameFolderName(f, 5);
if(strcmp(f, "csgo")) HookEvent("player_death", Event_PlayerDeath);
else HookEvent("player_death", Event_PlayerDeath_GO);
decl Handle:convar;
HookConVarChange(convar=CreateConVar("screen_duration", "300", "Продолжительность.",_, true, 0.0),Duration);
iDuration = GetConVarInt(convar);
HookConVarChange(convar=CreateConVar("screen_red", "0", "Красный цвет.",_, true, 0.0, true, 255.0),Red);
iColor[0] = GetConVarInt(convar);
HookConVarChange(convar=CreateConVar("screen_green", "0", "Зелёный цвет.",_, true, 0.0, true, 255.0),Green);
iColor[1] = GetConVarInt(convar);
HookConVarChange(convar=CreateConVar("screen_blue", "200", "Синий цвет.",_, true, 0.0, true, 255.0),Blue);
iColor[2] = GetConVarInt(convar);
HookConVarChange(convar=CreateConVar("screen_transparency", "255", "Прозрачность.",_, true, 0.0, true, 255.0),Transparency);
iColor[3] = GetConVarInt(convar);
CloseHandle(convar);
AutoExecConfig(true, "BlueScreenKill");
}
public Duration(Handle:convar, String:oldValue[], String:newValue[]) iDuration = GetConVarInt(convar);
public Red(Handle:convar, String:oldValue[], String:newValue[]) iColor[0] = GetConVarInt(convar);
public Green(Handle:convar, String:oldValue[], String:newValue[]) iColor[1] = GetConVarInt(convar);
public Blue(Handle:convar, String:oldValue[], String:newValue[]) iColor[2] = GetConVarInt(convar);
public Transparency(Handle:convar, String:oldValue[], String:newValue[]) iColor[3] = GetConVarInt(convar);
// Получение игрока-убийцы, применение к нему функции затемнения
public Event_PlayerDeath(Handle:event, String:name[], bool:dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if(attacker)
{
BfWriteShort(event=StartMessageOne("Fade",attacker),iDuration);
BfWriteShort(event,0);
BfWriteShort(event,0x0001);
BfWriteByte(event,iColor[0]);
BfWriteByte(event,iColor[1]);
BfWriteByte(event,iColor[2]);
BfWriteByte(event,iColor[3]);
EndMessage();
}
}
// Получение игрока-убийцы, применение к нему функции затемнения
public Event_PlayerDeath_GO(Handle:event, String:name[], bool:dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if(attacker)
{
PbSetInt(event=StartMessageOne("Fade",attacker),"duration",iDuration);
PbSetInt(event,"hold_time",0);
PbSetInt(event,"flags",0x0001|0x0010);
PbSetColor(event,"clr",iColor);
EndMessage();
}
}