Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/adminhelp.sp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Action HelpCmd(int client, int args)
cmdIter.GetName(name, sizeof(name));
cmdIter.GetDescription(desc, sizeof(desc));

if ((StrContains(name, arg, false) != -1) && CheckCommandAccess(client, name, cmdIter.Flags))
if ((StrContains(name, arg, false) != -1) && ((FindConVar(name).Flags & FCVAR_HIDDEN) == 0) && CheckCommandAccess(client, name, cmdIter.Flags))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't cmdIter.Flags already give you the flags, why the additional lookup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't cmdIter.Flags already give you the flags, why the additional lookup?

That is for admin flags and not command flags.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it would be a good idea to add it to the iterator before making this change - we don't need workarounds here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather add the convar flags property in a seperate PR and switch this over? It doesn't really fit the goal of this one.

{
PrintToConsole(client, "[%03d] %s - %s", i++, name, (desc[0] == '\0') ? noDesc : desc);
}
Expand All @@ -120,7 +120,7 @@ public Action HelpCmd(int client, int args)
{
cmdIter.GetName(name, sizeof(name));

if (CheckCommandAccess(client, name, cmdIter.Flags))
if (((FindConVar(name).Flags & FCVAR_HIDDEN) == 0) && CheckCommandAccess(client, name, cmdIter.Flags))
{
i++;
}
Expand All @@ -142,7 +142,7 @@ public Action HelpCmd(int client, int args)
cmdIter.GetName(name, sizeof(name));
cmdIter.GetDescription(desc, sizeof(desc));

if (CheckCommandAccess(client, name, cmdIter.Flags))
if (((FindConVar(name).Flags & FCVAR_HIDDEN) == 0) && CheckCommandAccess(client, name, cmdIter.Flags))
{
i++;
PrintToConsole(client, "[%03d] %s - %s", i+StartCmd, name, (desc[0] == '\0') ? noDesc : desc);
Expand Down