Weird issue with a loop
#1

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    #if defined LOG_ADMINS
    new logstring[64];
    new IP[17];
    format(IP, sizeof(IP), ip);
    if(success)
    {
      for(new i=0; i < MAX_PLAYERS; i++)
      {
        new plrip[17];
        GetPlayerIp(i, plrip, sizeof(plrip));
        if(!strcmp(IP, plrip, false, 17))
        {
          new name[MAX_PLAYER_NAME];
          GetPlayerName(i, name, sizeof(name));
          format(logstring, sizeof(logstring), "RCON: Player %s(ID %d, IP: %s) logged in.", name, i, IP);
            }
            else format(logstring, sizeof(logstring), "RCON: IP %s logged in.", IP);
        }
        WriteToLogFile(logstring);
    }
    if(!success)
    {
      for(new i=0; i < MAX_PLAYERS; i++)
      {
        new plrip[17];
        GetPlayerIp(i, plrip, sizeof(plrip));
        if(!strcmp(IP, plrip, false, 17))
        {
          new name[MAX_PLAYER_NAME];
          GetPlayerName(i, name, sizeof(name));
          format(logstring, sizeof(logstring), "RCON: Player %s(ID %d, IP: %s) tried to login as RCON, but failed.", name, i, IP);
            }
            else format(logstring, sizeof(logstring), "RCON: IP %s tried to login as RCON, but failed.", IP);
        }
        WriteToLogFile(logstring);
    }
    #endif
    return 1;
}
It works but when I open my log file it shows "RCON: Player (ID:499, IP: 127.0.0.1) has logged in."

Why does it start at 499? o.0
Reply


Messages In This Thread
Weird issue with a loop - by biltong - 08.04.2010, 19:15
Re: Weird issue with a loop - by Sascha - 08.04.2010, 19:52
Re: Weird issue with a loop - by biltong - 08.04.2010, 20:01
Re: Weird issue with a loop - by dice7 - 08.04.2010, 20:03
Re: Weird issue with a loop - by biltong - 08.04.2010, 20:14
Re: Weird issue with a loop - by dice7 - 08.04.2010, 20:16
Re: Weird issue with a loop - by M4S7ERMIND - 08.04.2010, 20:19
Re: Weird issue with a loop - by biltong - 08.04.2010, 20:42
Re: Weird issue with a loop - by M4S7ERMIND - 08.04.2010, 21:16
Re: Weird issue with a loop - by biltong - 08.04.2010, 21:20

Forum Jump:


Users browsing this thread: 1 Guest(s)