SA-MP Forums Archive
[HELP] Refusing to login - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Refusing to login (/showthread.php?tid=112227)



[HELP] Refusing to login - FreddeN - 06.12.2009

This is the problem, it works great until I logout and edit my %s.ini file, I was about to edit my admin rank to 1338.
After editing and trying to login it just tells me Invalid Password.

Here is my full script:

http://pastebin.com/f35a3799

Thank you for all your help


Re: [HELP] Refusing to login - DJDhan - 06.12.2009

Try returning 1 in both if(userfile) and else if.
And then there is already return 1 outside.


Re: [HELP] Refusing to login - FreddeN - 06.12.2009

Quote:
Originally Posted by DJDhan
Try returning 1 in both if(userfile) and else if.
And then there is already return 1 outside.
Can you show me in a little more detail how to do it


Re: [HELP] Refusing to login - DJDhan - 06.12.2009

Код:
if (UserFile)
783.    {
784.        new valtmp[128];
785.        fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
786. 
787.        if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
788.        {
789.            new key[128],val[128];
790.            new Data[128];
791.            while(fread(UserFile,Data,sizeof(Data)))
792.            {
793.                key = ini_GetKey(Data);
794.                if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
795.                if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMoney] = strval( val ); }
796.                if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
797.                GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]);
798.            }
799.            fclose(UserFile);
800.            gPlayerLogged[playerid] = 1;
801.            gPlayerAccount[playerid] = 1;
802.          GetPlayerName(playerid, pname3, sizeof(pname3));
803.            format(string3, sizeof(string3), "You have been successfully logged in");
804.            SendClientMessage(playerid, 0xFFFFFFFF,string3);return 1;
805.        }
806.        else
807.        {
808.            SendClientMessage(playerid, 0xC0C0C0FF, "    Invalid Password");
809.            fclose(UserFile);return 1;//maybe return 0
810.        }
811.    }
812.    return 1;
813.}
try replacing with this.
Not sure


Re: [HELP] Refusing to login - FreddeN - 09.12.2009

Sorry for a late answer, but this didnt fix it.