28.10.2011, 20:05
Hello, I ran into troubles making an automatically login system... but it doesn't work
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?
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", "");
}
}