# HG changeset patch # User David Anderson # Date 1181277640 0 # Node ID b42be6b5f221793bfe0cfbf80d4644531238de37 # Parent 2cd3d817b5ab1dec7ad0920e6b2f5b554e0d1f99 added request amb369, part 1 diff -r 2cd3d817b5ab -r b42be6b5f221 plugins/basecommands.sp --- a/plugins/basecommands.sp Fri Jun 08 03:50:23 2007 +0000 +++ b/plugins/basecommands.sp Fri Jun 08 04:40:40 2007 +0000 @@ -33,6 +33,8 @@ url = "http://www.sourcemod.net/" }; +new Handle:hBanForward = INVALID_HANDLE; + public OnPluginStart() { LoadTranslations("common.cfg"); @@ -45,6 +47,8 @@ RegAdminCmd("sm_who", Command_Who, ADMFLAG_GENERIC, "sm_who [#userid|name]"); RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> [reason]"); RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban "); + + hBanForward = CreateGlobalForward("OnClientBanned", ET_Ignore, Param_Cell, Param_Cell, Param_String); } public Action:Command_Unban(client, args) @@ -137,6 +141,13 @@ LogMessage("\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, clients[0], time, reason); + /* Fire the ban forward */ + Call_StartForward(hBanForward); + Call_PushCell(client); + Call_PushCell(clients[0]); + Call_PushString(reason); + Call_Finish(); + if (reason[0] == '\0') { strcopy(reason, sizeof(reason), "Banned"); diff -r 2cd3d817b5ab -r b42be6b5f221 plugins/include/functions.inc --- a/plugins/include/functions.inc Fri Jun 08 03:50:23 2007 +0000 +++ b/plugins/include/functions.inc Fri Jun 08 04:40:40 2007 +0000 @@ -310,7 +310,7 @@ * @return SP_ERROR_NONE on success, any other integer on failure. * @error Called before a call has been started. */ -native Call_Finish(&result); +native Call_Finish(&result=0); /** * Cancels a call to a function or forward's call list. diff -r 2cd3d817b5ab -r b42be6b5f221 plugins/include/helpers.inc --- a/plugins/include/helpers.inc Fri Jun 08 03:50:23 2007 +0000 +++ b/plugins/include/helpers.inc Fri Jun 08 04:40:40 2007 +0000 @@ -19,6 +19,15 @@ #define _helpers_included /** + * Provided by basecommands.sp when sm_ban is called. + * + * @param admin Admin client index. + * @param client Client index which will be banned. + * @param reason Ban reason (may be empty if none exists). + */ +forward OnClientBanned(admin, client, const String:reason[]); + +/** * Formats a user's info as log text. * * @param client Client index.