Users Input

Gang67

|Jump out gang, we jump out those vehicles|
May 5, 2017
303
54
Just wondering how I get what the user has entered. For example if there was a command saying :rob x 20, how would I get the '20'
 

Blasteh

Lord Farquaad
Apr 3, 2013
1,151
513
Just wondering how I get what the user has entered. For example if there was a command saying :rob x 20, how would I get the '20'
Not too sure what you're trying to achieve, but, this would be set in the parameters in the document. For example, this is the pay command.

Code:
public string Parameters
{
    get { return "%username% %type% %amount%"; }
}

If this is what you're talking about that is.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Params is an array inside the command manager. Params[0] would be the command
Params[1] would be the username
Params[2] would be the amount/20
 

Gang67

|Jump out gang, we jump out those vehicles|
May 5, 2017
303
54
Not too sure what you're trying to achieve, but, this would be set in the parameters in the document. For example, this is the pay command.

Code:
public string Parameters
{
    get { return "%username% %type% %amount%"; }
}

If this is what you're talking about that is.
Params is an array inside the command manager. Params[0] would be the command
Params[1] would be the username
Params[2] would be the amount/20
Sorry I rushed this and didn't explain it properly. For example if I was making a 'Guess the number' game and two people have to keep guessing until they're correct, how would I go about doing that
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Sorry I rushed this and didn't explain it properly. For example if I was making a 'Guess the number' game and two people have to keep guessing until they're correct, how would I go about doing that

You would have to store the number.
User says the command, it would compare the users input to that number

If number matches --> Player Wins
If number does not match --> Player Continues to Guess, Nothing Happens, Incorrect Number Warning

I would create a timestamp to keep track of when the game was started, and after 15 minutes just have the game timeout and close the class. This way you don't get multiple sessions going at the same time that can take up a lot of memory.
 

Users who are viewing this thread

Top