SA-MP Forums Archive
Why does this not log me in ? - 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)
+--- Thread: Why does this not log me in ? (/showthread.php?tid=331783)



Why does this not log me in ? I will rep - Scripter12345 - 06.04.2012

So this is from a filterscript ( Xtreme's ) I think


Im just wondering why does this not automatically log me in once i have registered ?


pawn Код:
public OnPlayerConnect(playerid) {
    new string[256],PlayerName[24],file[256]; file = GetPlayerFile(playerid);
    GetPlayerName(playerid,PlayerName,24); if(!dini_Exists(file)) CreateUserConfigFile(playerid);
    for(new i = 0; i < 100; i++) {
        if(strfind(PlayerName,ForbidNames[i],true)!=-1 && Config[ForbidData]) {
            switch(Config[ForbidData]) { case 1: Kick(playerid); case 2: Ban(playerid); }
            return 1;
        }
    }
    if(Config[DisplayServerMessage]) { format(string,sizeof(string),"Server Message: %s",dini_Get("/xadmin/Configuration/Configuration.ini","ServerMessage")); SendClientMessage(playerid,green,string); }
    Variables[playerid][Registered] = GetPlayerFileVar(playerid,"Registered"),
    Variables[playerid][Level] = GetPlayerFileVar(playerid,"Level");
    Variables[playerid][Wired] = GetPlayerFileVar(playerid,"Wired");
    Variables[playerid][Jailed] = GetPlayerFileVar(playerid,"Jailed");
    if(Variables[playerid][Wired]) SetUserInt(playerid,"WiredWarnings",Config[WiredWarnings]);
    if(Variables[playerid][Level] > Config[MaxLevel]) { Variables[playerid][Level] = Config[MaxLevel]; SetUserInt(playerid,"Level",Config[MaxLevel]); }
    if(!Variables[playerid][Registered]) format(string,256,"Welcome, %s.To register a account, type \"/REGISTER <PASSWORD>\".",PlayerName);
    else {
        new tmp[50],tmp2[256]; GetPlayerIp(playerid,tmp,50); tmp2 = dini_Get(file,"IP");
        if(!strcmp(tmp,tmp2,true)) {
            format(string,256,"Welcome back, %s. You have automatically been logged in.",PlayerName);
            Variables[playerid][LoggedIn] = true;
        }
        else {
            format(string,256,"Welcome back, %s. To log back into your account, type \"/LOGIN <PASSWORD>\".",PlayerName);
            Variables[playerid][LoggedIn] = false;
        }
    }
    SendClientMessage(playerid,yellow,string);
    for(new i = 0; i < MAX_VEHICLES; i++) if(VehicleLockData[i]) SetVehicleParamsForPlayer(i,playerid,false,true);
    if(Config[DisplayConnectMessages]) { format(string,256,"*** %s has joined the server.",PlayerName); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && playerid != i) SendClientMessage(i,grey,string); }
    return 1;
}

Thank You


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

Please Help Me Please


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

Please Help Me Is It Something To Do With The FilterScript Or The GM ?


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

60+ Views and no comments ?


Please Help


Re: Why does this not log me in ? - jop9888 - 06.04.2012

i quess its because the IP should be Intget, not get as it is an integer,

also i dont get if(!strcmp(tmp,tmp2,true)) {

it says if the tmp and tmp2 are NOT the same


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

Quote:
Originally Posted by jop9888
Посмотреть сообщение
i quess its because the IP should be Intget, not get as it is an integer,

also i dont get if(!strcmp(tmp,tmp2,true)) {

it says if the tmp and tmp2 are NOT the same
So what should i remove ?


Re: Why does this not log me in ? - MadeMan - 06.04.2012

Add a debug message to see if it's getting the right IPs

pawn Код:
new tmp[50],tmp2[256]; GetPlayerIp(playerid,tmp,50); tmp2 = dini_Get(file,"IP");
printf("tmp=|%s|   tmp2=|%s|",tmp,tmp2);
Then run the server, connect and check server console.


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Add a debug message to see if it's getting the right IPs

pawn Код:
new tmp[50],tmp2[256]; GetPlayerIp(playerid,tmp,50); tmp2 = dini_Get(file,"IP");
printf("tmp=|%s|   tmp2=|%s|",tmp,tmp2);
Then run the server, connect and check server console.
Yes it is getting the IPS


Please Help Me


Re: Why does this not log me in ? - MadeMan - 06.04.2012

What does it say when you connect?


Re: Why does this not log me in ? - Scripter12345 - 06.04.2012

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
What does it say when you connect?
It just says " Welcome Back Test_Account, You have been automatically logged in" But i just sit on the same screen and i cant do anything....


Please Help