diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 728d1fd0..5dc5f893 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -797,6 +797,11 @@ static cell_t GetCmdReplyTarget(IPluginContext *pContext, const cell_t *params) return g_ChatTriggers.GetReplyTo(); } +static cell_t SetCmdReplyTarget(IPluginContext *pContext, const cell_t *params) +{ + return g_ChatTriggers.SetReplyTo(params[1]); +} + REGISTER_NATIVES(consoleNatives) { {"CreateConVar", sm_CreateConVar}, @@ -833,5 +838,6 @@ REGISTER_NATIVES(consoleNatives) {"FakeClientCommand", FakeClientCommand}, {"ReplyToCommand", ReplyToCommand}, {"GetCmdReplySource", GetCmdReplyTarget}, + {"SetCmdReplyTarget", SetCmdReplyTarget}, {NULL, NULL} }; diff --git a/plugins/include/console.inc b/plugins/include/console.inc index 141ef80f..090be28f 100644 --- a/plugins/include/console.inc +++ b/plugins/include/console.inc @@ -183,6 +183,17 @@ native ReplyToCommand(client, const String:format[], any:...); */ native ReplySource:GetCmdReplySource(); +/** + * Sets the current reply source of a command. + * + * Only use this if you know what you are doing. You should save the old value + * and restore it once you are done. + * + * @param source New ReplySource value. + * @return Old ReplySource value. + */ +native ReplySource:SetCmdReplySource(ReplySource:source); + /** * Displays usage of an admin command to users depending on the * setting of the sm_show_activity cvar. Additionally, the client