diff --git a/core/smn_console.cpp b/core/smn_console.cpp index e2be7a50..63417144 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -1136,6 +1136,7 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params ConCmdIter *pIter; cell_t *pIsCmd, *pFlags; const ConCommandBase *pConCmd; + const char *desc; pContext->LocalToPhysAddr(params[3], &pIsCmd); pContext->LocalToPhysAddr(params[4], &pFlags); @@ -1151,6 +1152,12 @@ static cell_t FindFirstConCommand(IPluginContext *pContext, const cell_t *params *pIsCmd = pConCmd->IsCommand() ? 1 : 0; *pFlags = pConCmd->GetFlags(); + if (params[6]) + { + desc = pConCmd->GetHelpText(); + pContext->StringToLocalUTF8(params[5], params[6], (desc && desc[0]) ? desc : "", NULL); + } + pIter = new ConCmdIter; pIter->pLast = pConCmd; @@ -1169,6 +1176,7 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params) HandleError err; ConCmdIter *pIter; cell_t *pIsCmd, *pFlags; + const char *desc; HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent); if ((err = g_HandleSys.ReadHandle(params[1], htConCmdIter, &sec, (void **)&pIter)) != HandleError_None) @@ -1193,6 +1201,12 @@ static cell_t FindNextConCommand(IPluginContext *pContext, const cell_t *params) *pIsCmd = pIter->pLast->IsCommand() ? 1 : 0; *pFlags = pIter->pLast->GetFlags(); + if (params[7]) + { + desc = pIter->pLast->GetHelpText(); + pContext->StringToLocalUTF8(params[6], params[7], (desc && desc[0]) ? desc : "", NULL); + } + return 1; } diff --git a/plugins/include/console.inc b/plugins/include/console.inc index d866d5bd..84d04cd5 100644 --- a/plugins/include/console.inc +++ b/plugins/include/console.inc @@ -729,6 +729,8 @@ native bool:SetCommandFlags(const String:name[], flags); * @param isCommand Variable to store whether the entry is a command. * If it is not a command, it is a ConVar. * @param flags Variable to store entry flags. + * @param description Buffer to store the description, empty if no description present. + * @param descrmax_size Maximum size of the description buffer. * @return On success, a ConCmdIter Handle is returned, which * can be read via FindNextConCommand(), and must be * closed via CloseHandle(). Additionally, the output @@ -737,7 +739,7 @@ native bool:SetCommandFlags(const String:name[], flags); * On failure, INVALID_HANDLE is returned, and the * contents of outputs is undefined. */ -native Handle:FindFirstConCommand(String:buffer[], max_size, &bool:isCommand, &flags=0); +native Handle:FindFirstConCommand(String:buffer[], max_size, &bool:isCommand, &flags=0, String:description[]="", descrmax_size=0); /** * Reads the next entry in a ConCommandBase iterator. @@ -748,12 +750,14 @@ native Handle:FindFirstConCommand(String:buffer[], max_size, &bool:isCommand, &f * @param isCommand Variable to store whether the entry is a command. * If it is not a command, it is a ConVar. * @param flags Variable to store entry flags. + * @param description Buffer to store the description, empty if no description present. + * @param descrmax_size Maximum size of the description buffer. * @return On success, the outputs are filled, the iterator is * advanced to the next entry, and true is returned. * If no more entries exist, false is returned, and the * contents of outputs is undefined. */ -native bool:FindNextConCommand(Handle:search, String:buffer[], max_size, &bool:isCommand, &flags=0); +native bool:FindNextConCommand(Handle:search, String:buffer[], max_size, &bool:isCommand, &flags=0, String:description[]="", descrmax_size=0); /** * Replicates a convar value to a specific client. This does not change the actual convar value.