This repository was archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathins_killfeed.sp
More file actions
57 lines (46 loc) · 1.35 KB
/
ins_killfeed.sp
File metadata and controls
57 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public Plugin:myinfo = {
name = "[INS] Killfeed",
description = "Limit the killfeed and make it show only the teammate death",
author = "Neko-",
version = "1.0.0",
};
#define SPECTATOR_TEAM 0
#define TEAM_SPEC 1
#define TEAM_SECURITY 2
#define TEAM_INSURGENTS 3
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
char szWeaponEventName[64];
GetEventString(event, "weapon", szWeaponEventName, sizeof(szWeaponEventName));
if(StrEqual(szWeaponEventName, "Dropped a flare"))
{
return Plugin_Continue;
}
int nAttackerID = GetEventInt(event, "attacker");
int nAttacker = GetClientOfUserId(nAttackerID);
if(!IsValidClient(nAttacker))
{
return Plugin_Continue;
}
int nAttackerTeam = GetClientTeam(nAttacker);
//If attacker is security team then don't show in the killfeed
//We don't want them to know if they kill the enemy or not to make it realistic
if(nAttackerTeam == TEAM_SECURITY)
{
return Plugin_Handled;
}
return Plugin_Continue;
}
bool:IsValidClient(client)
{
if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) )
return false;
return true;
}