Dialog
#1

Код:
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 
Reply
#2

try isnull
Reply
#3

Not functioning, my password is 123123 and enter password current 123123 and asks for a new password, I press empty dialog with out New password is 23123
Reply
#4

i also have some trouble with dialogs. ( Not the same but post it here because i don't think its needed to create a new topic)

I'm trying to get a dialog triggerd on an other player when using iam using a command.
Example. type /Showrules 1
and it opens the rules dialog for Player with ID 1.

any one have any idea?
Reply
#5

Quote:
Originally Posted by DutchBoy
Посмотреть сообщение
i also have some trouble with dialogs. ( Not the same but post it here because i don't think its needed to create a new topic)

I'm trying to get a dialog triggerd on an other player when using iam using a command.
Example. type /Showrules 1
and it opens the rules dialog for Player with ID 1.

any one have any idea?
Just use a input box and then ondialogresponse strval the inputtext and display the rules to the player :P

Код:
CMD:showrules(playerid, params[])
{
	Dialog_Show(playerid, RulesOtherPlayer, DIALOG_STYLE_INPUT, ""EMBED_YELLOW"Player Selection:", "Please input player ID!", "Next", "Cancel");
	return 1;
}
Код:
Dialog:RulesOtherPlayer(playerid, response, listitem, inputtext[])
{
	if(response)
	{
		new Player = strval(inputtext);
		SendClientMessage(Player, -1, "Message")
	}
	return 1;
}
Reply
#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
#7

No function
Reply
#8

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)