|
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
|
01-29-2019
, 01:38
Re: [REQ] Ban on disconnect and works with SourceBans ($$)
|
#10
|
Quote:
Originally Posted by arne1288
PHP Code:
#include <sourcemod>
#include <pugsetup>
#include <sourcebanspp>
#pragma semicolon 1
#pragma newdecls required
ConVar g_hCVBanTime;
ConVar g_hCVBanReason;
bool g_bSourcebans = false;
bool g_bPugSetup = false;
public Plugin myinfo =
{
name = "Disconnect Ban",
author = "The Doggy",
description = "Bans players who disconnect during a match",
version = "1.0.0",
url = "DistrictNine.Host"
};
public void OnPluginStart()
{
g_hCVBanTime = CreateConVar("sm_disconnectban_time", "0", "Amount of time to ban a player who disconnects during a match");
g_hCVBanReason = CreateConVar("sm_disconnectban_reason", "Disconnected from match", "Reason to tell user why they were banned.");
}
public void OnAllPluginsLoaded()
{
if(LibraryExists("sourcebans++"))
g_bSourcebans = true;
else
LogError("Sourcebans++ is not loaded, this plugin will not work without it.");
if(LibraryExists("pugsetup"))
g_bPugSetup = true;
else
LogError("PugSetup is not loaded, this plugin will not work without it.");
}
public void OnLibraryAdded(const char[] name)
{
if(StrEqual(name, "sourcebans++"))
g_bSourcebans = true;
if(StrEqual(name, "pugsetup"))
g_bPugSetup = true;
}
public void OnLibraryRemoved(const char[] name)
{
if(StrEqual(name, "sourcebans++"))
{
g_bSourcebans = false;
LogError("Sourcebans++ has been unloaded, this plugin will not work without it.");
}
if(StrEqual(name, "pugsetup"))
{
g_bPugSetup = false;
LogError("PugSetup has been unloaded, this plugin will not work without it.");
}
}
public void OnClientDisconnect(int Client)
{
if(!g_bSourcebans || !g_bPugSetup) return;
if(!CheckCommandAccess(Client, "sm_disconnectban_immune", ADMFLAG_ROOT) && PugSetup_IsMatchLive() && PugSetup_PlayerAtStart(Client))
{
char sReason[256];
g_hCVBanReason.GetString(sReason, sizeof(sReason));
SBPP_BanPlayer(0, Client, g_hCVBanTime.IntValue, sReason);
}
}
Then your relevant admins (e.g. the admin groups), allowing them access to the "sm_disconnectban_immune" override, and they will not be punished.
|
can you add ban after a delay time? like give them 5 mints to join tha match again after that ban.
__________________
|
|
|
|