OnRconLoginAttempt is a spam?
#1

I got this code:

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            new pIp[30];
            GetPlayerIp(i, pIp, sizeof(pIp));
            if(strcmp(ip, pIp, true)==0)
            {
                new name[24];
                GetPlayerName(i, name, 24);
                printf("Rcon Login Attempt by %s(%d) using password: %s", name, ip, password);
            }
        }
    }
    return 1;
}
As you see in the picture below it doesnt return my name, and the ip returns as 49 when its 127.0.0.1, but the password is right tough.
Here is a screenie of the console after a failed in-game login with the password "Lol":

---------------------------------------
Reply
#2

Switch these...

pawn Код:
if(!success)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
Reply
#3

that shouldnt matter.. try returning 0 after the print statement.
Reply
#4

Try this, it worked for me:

pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        new pIp[30], name[24];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            GetPlayerIp(i, pIp, sizeof(pIp));
            if(strcmp(ip, pIp, true) == 0 && IsPlayerConnected(i))
            {
                GetPlayerName(i, name, 24);
                printf("Rcon Login Attempt by %s(%s) using password: %s", name, ip, password);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)