Jump to content

Possible to open specific page via command?

Not a Bug 3.2.21

Nomad3211
Nomad3211

Posted

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.

David

Posted

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");
}

 

David

Posted

Changed Status from Pending to Not a Bug

Nomad3211

Posted (edited)

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.

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11.1k
Customers served
Files Sold
158.7k
Marketplace sales
Payments
3.4m
Processed total
×
×
  • 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.