Dialog
#6

Quote:
Originally Posted by SpaceRP
Посмотреть сообщение
Код:
CMD:changepass(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
		ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit");
	}
	return 1;
}
Код:
fDialog(335)
{
	if(response)
	{
		if(PlayerInfo[playerid][pPassword] == udb_hash(inputtext)) { ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write new password", "Ok", "Exit"); }
		else { ShowPlayerDialog(playerid, 335, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit"); }
	}
	return 1;
}
Код:
fDialog(342)
{
	if(response)
	{
		new string[69];
		if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit");
		if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit");
		if(strfind(inputtext, "%") != -1) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit");
		PlayerInfo[playerid][pPassword] = udb_hash(inputtext);
		//strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255);
		format(string, sizeof(string), "New password is %s", inputtext);
		SCM(playerid, COLOR_WHITE,string);
	}
	return 1;
}
Код:
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", Eexit");

Not functioning, press empty dialog it accepts 
Try this

Код:
fDialog(342)
{
    if(response)
    {
        new newpass = strlen(inputtext),string[69];
        if(!strlen(inputtext))
        {
            ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit");
            return 1;
        }
        else if(!(6 <= newpass <= 20))
        {
            ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit");
            return 1;
        }
        else if(strfind(inputtext, "%") != -1)
        {
            ShowPlayerDialog(playerid, 342, DIALOG_STYLE_PASSWORD, "Password", "Write current password", "Ok", "Exit");
            return 1;
        }
        PlayerInfo[playerid][pPassword] = udb_hash(inputtext);
        //strmid(PlayerInfo[playerid][pPassword], inputtext, 0, strlen(inputtext), 255);
        format(string, sizeof(string), "New password is %s", inputtext);
        SCM(playerid, COLOR_WHITE,string);
    }
    return 1
}
Reply


Messages In This Thread
Dialog - by SpaceRP - 08.03.2017, 11:02
Re: Dialog - by SyS - 08.03.2017, 11:14
Re: Dialog - by SpaceRP - 08.03.2017, 11:38
Re: Dialog - by DutchBoy - 08.03.2017, 12:41
Re: Dialog - by JessThompson - 08.03.2017, 12:49
Re: Dialog - by JessThompson - 08.03.2017, 12:55
Re: Dialog - by SpaceRP - 08.03.2017, 14:48
Re: Dialog - by SpaceRP - 18.03.2017, 13:12

Forum Jump:


Users browsing this thread: 1 Guest(s)