command args

Azymok ☏ ✈

Member
Member
Jun 18, 2016
38
0
6
28
Canada
tell me how to do this - suffer terribly when tracing commands with no arguments - get the description of the plugin - if there are arguments , then check what is the argument and for further action by C#
 

Azymok ☏ ✈

Member
Member
Jun 18, 2016
38
0
6
28
Canada
Still don't really understand =/
Fucked....

Example

if (cmd == "test")
{
Server.Broadcast("description");
}
if (args[0] == "start")
{
Server.Broadcast("start");
}
if (args[0] == "go")
{
Server.Broadcast("go");
}

But if you enter /test getting errors
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
C#:
if (cmd == "test")
{
    if (args.Length == 0)
    {
        Server.Broadcast("description");
        return;
    }
    if (args[0] == "start")
    {
        Server.Broadcast("start");
    }
    else if (args[0] == "go")
    {
        Server.Broadcast("go");
    }
}
 

Azymok ☏ ✈

Member
Member
Jun 18, 2016
38
0
6
28
Canada
C#:
if (cmd == "test")
{
    if (args.Length == 0)
    {
        Server.Broadcast("description");
        return;
    }
    if (args[0] == "start")
    {
        Server.Broadcast("start");
    }
    else if (args[0] == "go")
    {
        Server.Broadcast("go");
    }
}
That's what I was trying to find out :)
 

Azymok ☏ ✈

Member
Member
Jun 18, 2016
38
0
6
28
Canada
C#:
if (cmd == "test")
{
    if (args.Length == 0)
    {
        Server.Broadcast("description");
        return;
    }
    if (args[0] == "start")
    {
        Server.Broadcast("start");
    }
    else if (args[0] == "go")
    {
        Server.Broadcast("go");
    }
}
I'm just doing at the moment PRG systems - and unfortunately was not able to do auto-level rise - will have to do to the players themselves through the team raised the level