diff --git a/Client/mods/deathmatch/ClientCommands.cpp b/Client/mods/deathmatch/ClientCommands.cpp index 84529b4c9d5..1940d7cb572 100644 --- a/Client/mods/deathmatch/ClientCommands.cpp +++ b/Client/mods/deathmatch/ClientCommands.cpp @@ -101,7 +101,27 @@ bool COMMAND_Executed(const char* szCommand, const char* szArguments, bool bHand { // Call the onClientCoreCommand event CLuaArguments Arguments; + CLuaArguments LuaTable; + std::istringstream iss(szArguments); + std::string arguments; + int i = 0; + + while (iss >> arguments) + { + ++i; + if (stricmp(szCommand, "connect") == 0 && i == 4) + { + LuaTable.PushNumber(i); + LuaTable.PushString("***"); + } + else + { + LuaTable.PushNumber(i); + LuaTable.PushString(arguments.c_str()); + } + } Arguments.PushString(szCommand); + Arguments.PushTable(&LuaTable); localPlayer->CallEvent("onClientCoreCommand", Arguments, true); } diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index b5a48a1e754..3b586896b27 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -2717,7 +2717,7 @@ void CClientGame::AddBuiltInEvents() // Console events m_Events.AddEvent("onClientConsole", "text", NULL, false); - m_Events.AddEvent("onClientCoreCommand", "command", NULL, false); + m_Events.AddEvent("onClientCoreCommand", "command, arguments", NULL, false); // Chat events m_Events.AddEvent("onClientChatMessage", "text, r, g, b, messageType", NULL, false);