SA-MP Forums Archive
Kick failed Rcon thing. Duplicate Strings. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Kick failed Rcon thing. Duplicate Strings. (/showthread.php?tid=136213)



Kick failed Rcon thing. Duplicate Strings. - BP13 - 24.03.2010

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;
}



Re: Kick failed Rcon thing. Duplicate Strings. - CJ101 - 24.03.2010

add return 1; ??
(after kick)