Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Add support for DeathMatch.TF and administration-agnostic bans #187

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripting/lilac.sp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public void OnAllPluginsLoaded()
sourcebanspp_exist = LibraryExists("sourcebans++");
sourcebans_exist = LibraryExists("sourcebans");
materialadmin_exist = LibraryExists("materialadmin");
dmtf_exist = LibraryExists("dmtf");

if (LibraryExists("updater"))
lilac_update_url();
Expand Down Expand Up @@ -229,6 +230,8 @@ public void OnLibraryAdded(const char []name)
sourcebans_exist = true;
else if (StrEqual(name, "materialadmin"))
materialadmin_exist = true;
else if (StrEqual(name, "dmtf"))
dmtf_exist = true;
else if (StrEqual(name, "updater"))
lilac_update_url();
}
Expand All @@ -241,6 +244,8 @@ public void OnLibraryRemoved(const char []name)
sourcebans_exist = false;
else if (StrEqual(name, "materialadmin"))
materialadmin_exist = false;
else if (StrEqual(name, "dmtf"))
dmtf_exist = false;
}

void lilac_update_url()
Expand Down
5 changes: 4 additions & 1 deletion scripting/lilac/lilac_config.sp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ void lilac_config_setup()
FCVAR_PROTECTED, true, 0.0, true, 1.0);
hcvar[CVAR_MA] = new Convar("lilac_materialadmin", "1",
"Ban players via Material-Admin (Fork of Sourcebans++. If it isn't installed, will default to sourcebans++ or basebans).",
FCVAR_PROTECTED, true, 0.0, true, 1.0);
FCVAR_PROTECTED, true, 0.0, true, 1.0);
hcvar[CVAR_DMTF] = new Convar("lilac_dmtf", "1",
"Ban players via DMTF. Not available for most servers. If it isn't present, will default to MaterialAdmin, SourceBans++ or basebans",
FCVAR_PROTECTED, true, 0.0, true, 1.0);
hcvar[CVAR_SOURCEIRC] = new Convar("lilac_sourceirc", "1",
"Enable reflecting log messages to SourceIRC channels flagged with 'lilac', if SourceIRC is available.",
FCVAR_PROTECTED, true, 0.0, true, 1.0);
Expand Down
6 changes: 4 additions & 2 deletions scripting/lilac/lilac_globals.sp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
#define CVAR_AUTO_UPDATE 36
#define CVAR_SOURCEIRC 37
#define CVAR_DATABASE 38
#define CVAR_MAX 39
#define CVAR_DMTF 39
#define CVAR_MAX 40

#define BHOP_INDEX_MIN 0
#define BHOP_INDEX_JUMP 1
Expand Down Expand Up @@ -176,6 +177,7 @@ Handle forwardhandleallow = INVALID_HANDLE;
bool sourcebans_exist = false;
bool sourcebanspp_exist = false;
bool materialadmin_exist = false;
bool dmtf_exist = false;

/* Logging.
* Todo: Might wanna move a lot of this variables to
Expand Down Expand Up @@ -205,4 +207,4 @@ native Function MABanPlayer(int iClient, int iTarget, int iType, int iTime, char
native Function SBBanPlayer(int client, int target, int time, const char[] reason);
native Function SBPP_BanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);
native Function Updater_AddPlugin(const char[] url);
native Function Updater_RemovePlugin();
native Function Updater_RemovePlugin();
3 changes: 2 additions & 1 deletion scripting/lilac/lilac_stock.sp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ void lilac_ban_client(int client, int cheat)
}


BanClient(client, get_ban_length(cheat), BANFLAG_AUTO, reason, reason, "lilac", 0);
//BanClient(client, get_ban_length(cheat), BANFLAG_AUTO, reason, reason, "lilac", 0);
ServerCommand("sm_ban #%d %d %s", GetClientUserId(client), get_ban_length(cheat), reason); // Console command; ban system-agnostic.
CreateTimer(5.0, timer_kick, GetClientUserId(client));
}

Expand Down