Skip to content

Commit

Permalink
Update annoyance_exploit_fixes
Browse files Browse the repository at this point in the history
- Blocks self-kicking.
- Blocks kicking of players in other teams.
  • Loading branch information
SirPlease committed Dec 19, 2023
1 parent 4613985 commit 6542293
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Binary file modified addons/sourcemod/plugins/fixes/annoyance_exploit_fixes.smx
Binary file not shown.
30 changes: 29 additions & 1 deletion addons/sourcemod/scripting/annoyance_exploit_fixes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ CEDAPug changes:
- Blocked return to lobby votes during live CEDAPug games.
- Blocked change campaign votes during live CEDAPug games.
============================== Version 0.2:
Callvote changes:
- Prevent clients from being able to kick players that are not on the same team.
- Prevent clients from kicking themselves.
*/

#pragma semicolon 1
Expand All @@ -27,7 +33,7 @@ public Plugin myinfo =
name = "[L4D2] Annoyance/Exploit Fixes",
author = "Sir",
description = "A compilation of 'fixes' to deal with annoyances and exploits.",
version = "0.1",
version = "0.2",
url = ""

}
Expand All @@ -51,6 +57,9 @@ public void OnCedapugEnded()

public Action Listener_CallVote(int client, const char[] command, int argc)
{
if (!client || !IsClientInGame(client))
return Plugin_Handled;

// Check if we can even do a vote
if (!IsNewBuiltinVoteAllowed)
{
Expand All @@ -76,6 +85,25 @@ public Action Listener_CallVote(int client, const char[] command, int argc)
return Plugin_Handled;
}

// ------------------------------------------------------------
// Kickvote
// ------------------------------------------------------------
if (strcmp(sVoteType, "Kick", false) == 0)
{
int target = GetClientOfUserId(StringToInt(sVoteArgument));

if (!target)
return Plugin_Handled;

// Block kickvotes not aimed at players in the same team.
if (GetClientTeam(target) != GetClientTeam(client))
return Plugin_Handled;

// Block self-kick
if (target == client)
return Plugin_Handled;
}

// ------------------------------------------------------------
// Change Map
// ------------------------------------------------------------
Expand Down

0 comments on commit 6542293

Please sign in to comment.