From fd9e6571969d42b09592d16ce22c48a2e79010eb Mon Sep 17 00:00:00 2001 From: Matthias Kollek Date: Wed, 28 Aug 2013 13:17:17 -0400 Subject: [PATCH] Add support for customizing ban reasons in basebans.sp (bug 5762, r=psychonic). --- plugins/basebans.sp | 114 ++++++++++++++++++++++++++++++ plugins/basebans/ban.sp | 60 ++++++++++------ translations/basebans.phrases.txt | 16 +++++ 3 files changed, 169 insertions(+), 21 deletions(-) diff --git a/plugins/basebans.sp b/plugins/basebans.sp index 95a21efe..668b0ace 100644 --- a/plugins/basebans.sp +++ b/plugins/basebans.sp @@ -52,18 +52,40 @@ new g_BanTarget[MAXPLAYERS+1]; new g_BanTargetUserId[MAXPLAYERS+1]; new g_BanTime[MAXPLAYERS+1]; +new g_IsWaitingForChatReason[MAXPLAYERS+1]; +new Handle:g_hKvBanReasons; +new String:g_BanReasonsPath[PLATFORM_MAX_PATH]; + #include "basebans/ban.sp" +public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) +{ + BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt"); + if(LoadBanReasons()) + { + return APLRes_Success; + } + else + { + Format(error, err_max, "Couldn't load file %s: See log for details.", g_BanReasonsPath); + return APLRes_Failure; + } +} + public OnPluginStart() { LoadTranslations("common.phrases"); LoadTranslations("basebans.phrases"); + LoadTranslations("core.phrases"); RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> [reason]"); RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban "); RegAdminCmd("sm_addban", Command_AddBan, ADMFLAG_RCON, "sm_addban