Commands C#

Reikenz

Member
Apr 5, 2018
64
3
Hello devbest,

I stuck a little in one of my orders

I would like that when we write the commands it looks like:
:event "Params 1" "Params 2" Params 3 "

I have his:
:event Params1 Params2 Params3

Of course impossible to make space otherwise its password to the next Params

I tried :
C#:
CommandManager.MergeParams (Params, 2);

That works but I have several text long enough to put and not that

So can anyone help me?
 

Reikenz

Member
Apr 5, 2018
64
3
I have this
C#:
string Image = Params[1];

            switch (Image)
            {
                case "event":
                    Image = "hotel_event";
                    break;

                case "animation":
                    Image = "game_event";
                    break;

                case "gift":
                    Image = "gift_event";
                    break;

                case "alert":
                    Image = "alert_event";
                    break;

                default:
                    Image = "search_event";
                    break;
            }

            string Contenu = CommandManager.MergeParams(Params, 2);
            string Description = CommandManager.MergeParams(Params, 3);
            string Title = CommandManager.MergeParams(Params, 4);
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
I have this
C#:
string Image = Params[1];

            switch (Image)
            {
                case "event":
                    Image = "hotel_event";
                    break;

                case "animation":
                    Image = "game_event";
                    break;

                case "gift":
                    Image = "gift_event";
                    break;

                case "alert":
                    Image = "alert_event";
                    break;

                default:
                    Image = "search_event";
                    break;
            }

            string Contenu = CommandManager.MergeParams(Params, 2);
            string Description = CommandManager.MergeParams(Params, 3);
            string Title = CommandManager.MergeParams(Params, 4);
Ok don't take the title as a parameter , hard code those based on the type of alert. Merge the rest of the command as the description...
 

Damien

Don't need glasses if you can C#
Feb 26, 2012
435
648
You could split the data using a different character other than space. For instance a semi colon.

Or just have predefined title and descriptions.

:event "param1" "param2;param3"
 

Users who are viewing this thread

Top