Kick failed Rcon thing. Duplicate Strings.
#1

The problem is that with this code it shows up like this:

Quote:

KICKED: has been kicked. (Reason: Failed RCON Login)
KICKED: [SU]BP13 has been kicked. (Reason: Failed RCON Login)

So if I add break; at the end it comes like this:

Quote:

KICKED: has been kicked. (Reason: Failed RCON Login)

No name and no kick. The above posted one (top first quote) does do its job but it has duplicate strings.

No idea what to do any help?


pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{  
  new pName2[MAX_PLAYER_NAME];
  if(!success) //If the password was incorrect
  {
    new pip[16];
    for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
      GetPlayerIp(i, pip, sizeof(pip));
      if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
      {
                new string [128];
                GetPlayerName(i, pName2, sizeof(pName2));
                format(string, sizeof(string), "KICKED: %s has been kicked. (Reason: Failed RCON Login)", pName2);
                SendClientMessageToAll(COLOR_RED, string);
        Kick(i);
      }
    }
  }
  return 1;
}
Reply
#2

add return 1; ??
(after kick)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)