need help something wrong with this code
#1

in this code there is no error but it is not functioning properly
this is login system
the person is able to log in the server if his password is correct or incorrect
code:
Код:
if (dialogid == dialog_login)
	{
	    new Pname[MAX_PLAYER_NAME];
		new name[MAX_PLAYER_NAME + 4];
		new password[30];
		new fail=1;
		GetPlayerName(playerid,Pname,sizeof(Pname));
		format(name,sizeof(name),"%s.txt",Pname);
		format(password,sizeof(password),"Password:%s|",inputtext);
		new File:check = fopen(name,io_read);
		while(fread(check,password))
		{
		    fail = 0;
 	        SendClientMessage(playerid,COLOR_WHITE,"successfully logged in");
			SpawnPlayer(playerid);
  		}
		if(fail)
		{
		    SendClientMessage(playerid,COLOR_GREY,"you failed to login please restart the game and login again");
		    Kick(playerid);
		}
	}
please help
Reply


Messages In This Thread
need help something wrong with this code - by akki - 15.03.2013, 08:29
Re: need help something wrong with this code - by Denying - 15.03.2013, 08:32
Re: need help something wrong with this code - by akki - 15.03.2013, 08:33
Re: need help something wrong with this code - by Denying - 15.03.2013, 08:35
Re: need help something wrong with this code - by akki - 15.03.2013, 08:38
Re: need help something wrong with this code - by P3DRO - 15.03.2013, 11:41

Forum Jump:


Users browsing this thread: 1 Guest(s)