limit code I added in the Plugin does not work stable. While testing, I reached the limit and no player can use this command anymore (even though they haven't used it before). and normally a limit value reset is required at the start of each round, but that doesn't work either, this command resets a timer. I don't understand where I made a mistake. can you help me?
PHP Code:
new iPenaltyCounter[MAXPLAYERS + 1]; //global varib
PHP Code:
AdminId clientId = GetUserAdmin(client);
if (clientId == INVALID_ADMIN_ID || iPounces[client] == 0)
{
PrintToChat(client, "\x05CountDown Cannot \x03Be Reset \x05Because You Didn't Do \x04Brutal!");
return Plugin_Handled;
}
if (iPenalty[client] < 3 && iPenaltyCounter[client] < 3)
{
iPenalty[client] = 0;
iPenaltyCounter[client]++;
CPrintToChat(client, "\x05You Can Used \x03Counts Reset \x04(\x03%i\x05/\x033\x04)", iPenaltyCounter[client]);
CPrintToChat(client, "iPenalty %i iPenaltyCounter %i client %i", iPenalty[client],client, iPenaltyCounter[client]);
}
else {
CPrintToChat(client, "\x05You Cannot Use Count Reset \x04Limit Reached.");
}
PHP Code:
public void OnClientPostAdminCheck(int client) {
//If I want, let's set back to 0 once he's inside our server
iPenaltyCounter[client] = 0;
}
Quote:
iPenaltyCounter[client] // This is a limit variable.
|
Quote:
iPenalty[client] // This is a timer variable
|