SA-MP Forums Archive
Problem with File - 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: Problem with File (/showthread.php?tid=290880)



Problem with File - avivelkayam - 17.10.2011

ok my problem its when i do wrong password it send me wrong password but when i do correct password its still send me wrong password

this is my code:


Код:
	if(dialogid == 1)
	{
	    new string[256];
	    if(!strlen(inputtext) || !response) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"дшщод","{DB881A}Fun-DeathMatch{00688B} бшелйн дбайн мщшъ\n\r айрк шщен мщшъ жд \n\r дчщ аъ сйсоък лгй мдшщн","айщеш","бйием");
		new File:pfile = fopen(file, io_write);
		format(string,sizeof(string),"Name:%s\r\nPassword:%s",GetName(playerid),inputtext);
		fwrite(pfile, string);
		fclose(pfile);
		Logged[playerid] = 1;
	}
	if(dialogid == 2)
	{
 		new pass[40],Line[256];
        new File:pfile = fopen(file, io_read);
        while (fread(pfile, Line, 256))
        {
            if(strcmp(Line,"Password",true,strlen(pass)) == 0)
            {
                new e = strfind(Line, "=", false);
                strcat(pass,Line[e+1]);
            }
        } fclose(pfile);

     	while(pass[strlen(pass)-1] == '\r' && pass[strlen(pass)-1] == '\n')
		{
			strdel(pass,strlen(pass)-1,strlen(pass));
		}
        if(strcmp(pass,inputtext,true) == 0)
        {
            SendClientMessage(playerid, 0xffffffff,"correct password");
        } else {
            SendClientMessage(playerid, 0xffffffff,"Wrong Password");
        }
  }



Re: Problem with File - avivelkayam - 18.10.2011

UPP plz help me


Re: Problem with File - nilanjay - 18.10.2011

Are you getting any warning?


Re: Problem with File - avivelkayam - 18.10.2011

Nope


Re: Problem with File - avivelkayam - 18.10.2011

UPP plz help me why nobody help me