Jump to content

Possible to open specific page via command?

Not a Bug 3.2.21

Hi there! 
Love the panel. I am getting creative with it and its coming along great. However, I would like to be able to fill out some pages with information on specific plugins and then open those pages directly.

Tab : Features 
->  Plugin pages

I know about the indexing for tabs and such, but is it possible to add another argument to specify a page OF a category as well? 
Kinda like /rules 2    opens second page of the Rules tab.

Share this comment


Link to comment

Only way would be to creating your own chat command which will execute welcome panel commands for you

example 

[ChatCommand("mycommandname")]
private void mycommandname(BasePlayer player)
{
	player.SendConsoleCommand("welcomepanellite_tab 2");
	player.SendConsoleCommand("welcomepanellite_page 2");
}

 

  • Like 1

Share this comment


Link to comment

Thank you!! 

I ended up making a universal command  that opens tab/pages that I specify. Here's the code I ended up adding :

 

[ConsoleCommand("welcomepanel")]

        private void welcomepanel(ConsoleSystem.Arg arg)
        {

            var player = arg?.Player();
            if (player == null) return;
            var args = arg.Args;
            if (args.Length != 2) return;
 
            int tab = int.Parse(args[0]);
            int page = int.Parse(args[1]);       

            OpenMain(player);
            OpenPage(player, tab, page);

        }

To use this command: 
Type      welcomepanel TAB PAGE   in the console. 

Example:

welcomepanel 1 0    will open first tab, first page. 

Edited by Nomad3211
Took un necessary spacing out of the copy/pasted code for easy reading.
  • Like 1

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.6k

Customers

Total customers served.

81.8k

Files Sold

Total number of files sold.

1.6m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.