Y_ini
#1

Hello, i'm a noob at samp scripting,
and i'm trying to make a login/register dialog using Y_INI
(IT'S NOT DONE YET)
now.. i can write to the INI file.. so register works...
Can anyone help me with these things:
- Make the login work (reading, because when i do what the Y_ini thread says, it doesn't work)
- How to hash the password?
Thanks!


Here is the code:
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new pname[128], account[128];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(account, sizeof(account), "Accounts/%s.ini", pname);
	if(dialogid == DIALOG_REGISTER)
	{
	if(!response) return Kick(playerid);
        if(response)
        {
            	if(strlen(inputtext) == 0)
            	{
            	ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "SF:RP - Register", "You didn't enter a password, please enter a password!", "Register", "Leave");
				return 0;
				}
			if(!fexist(account))
			{
			new
    		INI:ini = INI_Open(account);
    		INI_WriteString(ini, "username", pname);
			INI_WriteString(ini, "password", inputtext);
			INI_Close(ini);
			GivePlayerMoney(playerid, 1000);
			
			}
		
		}

	
	}
	if(dialogid == DIALOG_LOGIN)
	{
		if(!response) return Kick(playerid);
		if(response)
			{
				if(strlen(inputtext) == 0)
					{
						ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "SF:RP - Login", "You didn't enter a password, please enter a password!", "Login", "Leave");
 						return 0;
					}
				if(fexist(account))
			 		{
						//login
			 		}
			}
	}

	return 1;
}
And if there is any one who wants to add me on msn, so who can help me when i have a question..
send me a PM
Reply


Messages In This Thread
Y_ini - by Stefans94 - 07.03.2011, 16:09
Re: Y_ini - by sim_sima - 07.03.2011, 18:23
Re: Y_ini - by Zh3r0 - 07.03.2011, 18:49
Re: Y_ini - by Mean - 07.03.2011, 19:07
Re: Y_ini - by Stigg - 07.03.2011, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)