Quote:
Originally Posted by step
Also, could you share the source?
|
No, sorry. My client plugin framework includes a lot of work put into it.
This alone should be fine in a regular server plugin project though, just make sure to connect Tier1 and maybe Tier2, whichever has the g_pCVar extern.
I'll give you the code for the list command though:
PHP Code:
/**
* This software is in the public domain, furnished "as is", without technical
* support, and with no warranty, express or implied, as to its usefulness for
* any purpose.
*/
CON_COMMAND(derp, "") {
ConCommandBase *pNextCommand = g_pCVar->GetCommands();
do {
if (pNextCommand->IsCommand()) {
if (pNextCommand->IsFlagSet(FCVAR_HIDDEN))
g_pCVar->ConsoleColorPrintf(Color(255, 32, 32, 255), "%s - \"%s\"\n", pNextCommand->GetName(), pNextCommand->GetHelpText());
if (pNextCommand->IsFlagSet(FCVAR_DEVELOPMENTONLY))
g_pCVar->ConsoleColorPrintf(Color(255, 255, 32, 255), "%s - \"%s\"\n", pNextCommand->GetName(), pNextCommand->GetHelpText());
} else {
if (pNextCommand->IsFlagSet(FCVAR_HIDDEN))
g_pCVar->ConsoleColorPrintf(Color(32, 32, 255, 255), "%s - \"%s\" = \"%s\"\n", pNextCommand->GetName(), pNextCommand->GetHelpText(), ((ConVar *)pNextCommand)->GetString());
if (pNextCommand->IsFlagSet(FCVAR_DEVELOPMENTONLY))
g_pCVar->ConsoleColorPrintf(Color(32, 255, 32, 255), "%s - \"%s\" = \"%s\"\n", pNextCommand->GetName(), pNextCommand->GetHelpText(), ((ConVar *)pNextCommand)->GetString());
}
} while ((pNextCommand = pNextCommand->GetNext()) != NULL);
}
__________________