Answer the question
In order to leave comments, you need to log in
How to reset the counter and repeat everything over again?
How to reset the counter and start over?
Now it turns out that when it reaches zero, it constantly repeats the message "You ask too often.".
And I would like to start all over again when it reaches zero. Those. for every third request, display the message "You ask too often.".
Tried through while, but then it just ignores the message and issues all requests.
int counter = 2;
if (counter == 0)
{
return ("", "", "Вы спрашиваете слишком часто.");
}
counter--;
foreach (Player player in Players)
{
if (player.Name == str)
{
return (number: player.Number, gametime: player.GameTime, error: "");
}
}
return ("", "", "Не удалось найти.");
Answer the question
In order to leave comments, you need to log in
If I understand correctly, then yes.
int counter = 2;
if (counter == 0)
{
counter = 2;
return ("", "", "Вы спрашиваете слишком часто.");
}
int counter = 2;
if (counter == 0)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question