Skip to content

Commit

Permalink
Add log for autoteam
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Nov 21, 2023
1 parent 8883c32 commit 8f3abff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sourcemod/scripting/gbans.sp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void onPluginStartCore()
RegConsoleCmd("gb_mod", onCmdMod, "Ping a moderator");
RegConsoleCmd("mod", onCmdMod, "Ping a moderator");
RegConsoleCmd("report", onCmdReport, "Report a player");
RegConsoleCmd("autoteam", onCmdAutoTeamAction, "Disabled");
RegConsoleCmd("autoteam", onCmdAutoTeamAction);

RegAdminCmd("gb_ban", onAdminCmdBan, ADMFLAG_BAN);
RegAdminCmd("gb_reauth", onAdminCmdReauth, ADMFLAG_ROOT);
Expand Down
17 changes: 17 additions & 0 deletions sourcemod/scripting/gbans/balance.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
public Action onCmdAutoTeamAction(int clientId, int argc)
{
if (gDisableAutoTeam.BoolValue) {
KickClient(clientId, "Please stop trying to stack :(");

char auth_id[50];
if(!GetClientAuthId(clientId, AuthId_Steam3, auth_id, sizeof auth_id, true))
{
ReplyToCommand(clientId, "Failed to get auth_id of user: %d", clientId);
return Plugin_Continue;
}

char name[64];
if(!GetClientName(clientId, name, sizeof name))
{
gbLog("Failed to get user name?");
return Plugin_Continue;
}

gbLog("Autoteam blocked: %s [%s]", name, auth_id);
return Plugin_Handled;
}

Expand Down

0 comments on commit 8f3abff

Please sign in to comment.