|
Veteran Member
|
07-15-2022
, 14:29
Re: grey screen when death
|
#6
|
Quote:
Originally Posted by slava123
PHP Code:
#include <sourcemod>
public Plugin myinfo =
{
name = "Grey Screen On death",
author = "Addicted",
version = "1.0",
url = "oaaron.com"
};
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public Action Event_PlayerDeath(Handle event, const char[] name, bool dontbroadcast)
{
int victim = GetClientOfUserId(GetEventInt(event, "userid"));
if (victim < 1 || victim > MaxClients || !IsClientConnected(victim) || !IsClientInGame(victim) || IsFakeClient(victim))
return Plugin_Continue;
int clients[2];
clients[0] = victim;
int duration = 200,
holdtime = 200,
flags = (0x0001 | 0x0010),
color[4] = {211, 211, 211, 100};
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 //write them bytez
{
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();
return Plugin_Continue;
}
after some research i found that there is no event called victim you should replace it with userid which is user who died https://wiki.alliedmods.net/Counter-...s#player_death
|
Yeah my bad I am too sleepy I guess. Updated the main post.
__________________
|
|
|
|