Auto login problem :/
#1

Hello, I ran into troubles making an automatically login system... but it doesn't work
pawn Код:
public OnPlayerConnect(playerid)
{
    new tmpIP[16];
    GetPlayerIp(playerid,tmpIP,sizeof(tmpIP));
    LoadStats(playerid);
   
    aInfo[playerid][aLogged] = 0;
   
    if(aInfo[playerid][aRegistered] == 0)
    {
        SendClientMessage(playerid,COLOR_YELLOW,"This name hasn't been registered yet!");
        ShowPlayerDialog(playerid, DIALOG+2, DIALOG_STYLE_INPUT, "Auto register", "Please enter the password u want to choose below", "Proceed", "");
    }
    else
    {
        if(strcmp(tmpIP,aInfo[playerid][aIP],true) == 0)
        {
            SendClientMessage(playerid,COLOR_YELLOW,"|~ You have been automatically logged in with the following stats: ~|");
            SendClientMessage(playerid,COLOR_YELLOW,"|~ Stats ~|");
        }
        else
        {
            SendClientMessage(playerid,COLOR_YELLOW,"|~ Please login to your account. ~|");
            ShowPlayerDialog(playerid, DIALOG+3, DIALOG_STYLE_INPUT, "Login", "Please enter your password", "Proceed", "");
        }
    }
Now when I look at the file where I load all the variables, I can see the IP, and I'm sure that the aIP is the same as the current player IP, but for some reason I don't get the autologin message but the please login message... meaning that the server doesn't compara my IP with the saved IP?
Reply
#2

Add a debug message to your code that prints the tmpIP and the aInfo[playerid][aIP] value. It might be correct in the file but that doesn't mean it is correct in the comparison!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)