can I create console command with arguments like in chat commands?
I want one command for getting different info in console for example:
getinfo plugin
getinfo version
ConsoleCommand with argumentsSolved
oh I found it, it works like chat commands, I just messed up
[ConsoleCommand("something")]
private void cmd_something(ConsoleSystem.Arg cmdArgs)
{
PrintToConsole("this is the first argument: " + cmdArgs.Args[0]);
}
there are couple more options if anyone comes here,
this code is inside ConsoleSystem class:
public class Arg
{
public ConsoleSystem.Option Option;
public ConsoleSystem.Command cmd;
public string FullString = "";
public string[] Args;
public bool Invalid = true;
public string Reply = "";
public Connection Connection
{
get
{
return this.Option.Connection;
}
}
... and more
Locked automatically