Command doesn't exist!
#5

Here, I'm not all that sure why you're asking for two instances of the password in the params and then in the inputtext. But I tried to help you out a bit. Hopefully it helps.

Код:
dcmd_changepass(playerid,params[])
{
	if(!strcmp(params,"666",true))
	{
		ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
	}
    if (strlen(params) < 3 || strlen(params)>14)
	{
		SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters");
		ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
	}
	new newpass;
	new mess[MAX_STRING];
	newpass=udb_hash(params);
	dUserSetINT(PlayerName(playerid)).("password_hash",newpass);
	format(mess,sizeof(mess),"..: SUCCESS: Your password has been changed. :..",newpass);
	SendClientMessage(playerid,COLOR_SYSTEM_GM,mess);
	return 1;
}

public OnDialogResponse(playerid,dialogid,reponse,listitem,inputtext[])
{
	switch(dialogid)
	{
		case 3:
		{
			if(!response) return SendClientMessage(playerid, COLOR_SYSTEM_GM, "You have closed out of the password menu");
			if(response)
			{
				if (strlen(inputtext) < 3 || strlen(inputtext)>14)
				{
					SendClientMessage(playerid,COLOR_SYSTEM_GM,"Error, the password needs to be between 5 and 14 characters");
					ShowPlayerDialog(playerid, 3, DIALOG_STYLE_PASSWORD, "> Password", "Please enter your new password.", "Change", "Cancel");
				}
				new newpass;
				new mess[MAX_STRING];
				newpass=udb_hash(params);
				dUserSetINT(PlayerName(playerid)).("password_hash",newpass);
				format(mess,sizeof(mess),"..: SUCCESS: Your password has been changed. :..",newpass);
				SendClientMessage(playerid,COLOR_SYSTEM_GM,mess);
			}
		}
	}
	return 1;
}
Reply


Messages In This Thread
Command doesn't exist! - by MrAjusshi - 08.07.2017, 02:47
Re: Command doesn't exist! - by DTV - 08.07.2017, 03:47
Re: Command doesn't exist! - by Meller - 08.07.2017, 03:57
Re: Command doesn't exist! - by MrAjusshi - 08.07.2017, 05:47
Re: Command doesn't exist! - by Tass007 - 08.07.2017, 05:53
Re: Command doesn't exist! - by MrAjusshi - 08.07.2017, 06:11
Re: Command doesn't exist! - by Tass007 - 08.07.2017, 06:39

Forum Jump:


Users browsing this thread: 1 Guest(s)