Hay, is there any plugin that makes the bans you get when you get vote kicked added to Sourcebans instead? When you get vote kicked you get a ban for like 15 minutes and I would like to have it on Sourcebans for 15 minutes instead.
If it doesn’t exists that would be a cool thing to have, if someone is willing to code it, I would really appreciate it. Thanks in advance!
Hay, is there any plugin that makes the bans you get when you get vote kicked added to Sourcebans instead? When you get vote kicked you get a ban for like 15 minutes and I would like to have it on Sourcebans for 15 minutes instead.
If it doesn’t exists that would be a cool thing to have, if someone is willing to code it, I would really appreciate it. Thanks in advance!
I don't mean a menu. I mean the default votekick system. "Esc>Start A Vote>Votekick". That those bans, instead of saving in "cfg/banned_user.cfg", it is being added to SourceBans instead.
Is there a plugin for that? Or is someone willing to code it?
This will probably work. I don't have a test server with sourcebans installed - but I thought that the default ban command would add a ban to sourcebans automatically - if not you'd just need to replace the 'BanClient' part with one of the functions from the sourcebans include file.
Spoiler
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Ban on vote kick",
author = "dustin",
description = "",
version = "0.0.0",
url = ""
};
public void OnPluginStart()
{
HookEvent("player_disconnect", playerDisconnect, EventHookMode_Pre);
}
public Action playerDisconnect(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if ( 0 < client <= MaxClients)
{
if (IsClientInGame(client) && !IsFakeClient(client))
{
char sReason[52];
GetEventString(event, "reason", sReason, sizeof(sReason));
if (StrContains(sReason, "Kicked by Console", false) != -1)
{
BanClient(client, 15, BANFLAG_AUTO, "[SM] Vote kicked from server.", "[SM] Vote kicked from server.");
}
}
}
This will probably work. I don't have a test server with sourcebans installed - but I thought that the default ban command would add a ban to sourcebans automatically - if not you'd just need to replace the 'BanClient' part with one of the functions from the sourcebans include file.
Spoiler
PHP Code:
#include <sourcemod>
#pragma semicolon 1 #pragma newdecls required
public Plugin myinfo = { name = "Ban on vote kick", author = "dustin", description = "", version = "0.0.0", url = "" };
public void OnPluginStart() { HookEvent("player_disconnect", playerDisconnect, EventHookMode_Pre); }
public Action playerDisconnect(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(GetEventInt(event, "userid")); if ( 0 < client <= MaxClients) { if (IsClientInGame(client) && !IsFakeClient(client)) { char sReason[52]; GetEventString(event, "reason", sReason, sizeof(sReason));
if (StrContains(sReason, "Kicked by Console", false) != -1) { BanClient(client, 15, BANFLAG_AUTO, "[SM] Vote kicked from server.", "[SM] Vote kicked from server."); } } }
return Plugin_Continue; }
I got banned on the server, for 15 minutes, but didnt get added on Sourcebans. However, the thing Sourceban is using is BanClient (Check here: https://github.com/sbpp/sourcebans-p...g/sbpp_main.sp search for "BanClient).
So I get banned but not added to Sourcebans while Sourcebans and this plugin is using the same way to ban. Is this something you can fix?