I have problem with registration multiple dialogs.(Need some explanation or help) -
So here is my on dialog Response.. Now I need to make like male, female etc on player registration.
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dregister)
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
return 1;
}
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteString(file,"Password",hashpass);
INI_WriteInt(file,"AdminLevel",0);
INI_WriteInt(file,"VIPLevel",0);
INI_WriteInt(file,"Money",0);
INI_WriteInt(file,"Scores",0);
INI_WriteInt(file,"Kills",0);
INI_WriteInt(file,"Deaths",0);
INI_WriteInt(file,"Sex",0);
INI_WriteInt(file,"Member",0);
INI_WriteInt(file,"Leader",0);
INI_WriteInt(file,"House",0);
INI_WriteInt(file,"House1",0);
INI_WriteInt(file,"Car",0);
INI_WriteInt(file,"Car1",0);
INI_WriteInt(file,"Phone",0);
INI_WriteInt(file,"Number",0);
INI_WriteInt(file,"Skin",0);
INI_WriteInt(file,"Health",0);
INI_WriteInt(file,"Armor",0);
INI_WriteInt(file,"Player",0);
INI_WriteInt(file,"Fighting",0);
INI_WriteInt(file,"Walking",0);
INI_WriteInt(file,"Religion",0);
INI_WriteInt(file,"Accent",0);
INI_WriteInt(file,"WeaponSkill",0);
INI_WriteInt(file,"WeaponSkill1",0);
INI_WriteInt(file,"WeaponSkill2",0);
INI_WriteInt(file,"WeaponSkill3",0);
INI_WriteInt(file,"WeaponSkill4",0);
INI_WriteInt(file,"WeaponSkill5",0);
INI_WriteInt(file,"WeaponSkill6",0);
INI_WriteInt(file,"WeaponSkill7",0);
INI_WriteInt(file,"WeaponSkill8",0);
INI_WriteInt(file,"WeaponSkill9",0);
INI_WriteInt(file,"WeaponSkill10",0);
INI_WriteInt(file,"WeaponSkill11",0);
INI_WriteInt(file,"WeaponSkill12",0);
INI_WriteInt(file,"Cashbox",0);
INI_WriteInt(file,"Race",0);
INI_WriteInt(file,"DM",0);
INI_WriteInt(file,"Warning",0);
INI_WriteInt(file,"Banned",0);
INI_WriteInt(file,"IpBanned",0);
INI_WriteInt(file,"Respect",0);
INI_WriteInt(file,"Dice",0);
INI_WriteInt(file,"Ciggaretes",0);
INI_WriteInt(file,"Fork",0);
INI_WriteInt(file,"Spoon",0);
INI_WriteInt(file,"Drink",0);
INI_WriteInt(file,"Ciggars",0);
INI_WriteInt(file,"Sprunk",0);
INI_WriteInt(file,"Beer",0);
INI_WriteInt(file,"Wine",0);
INI_WriteInt(file,"Hennesy",0);
INI_WriteInt(file,"JackDaniels",0);
INI_WriteInt(file,"Coke",0);
INI_WriteInt(file,"Vodka",0);
INI_Close(file);
SendClientMessage(playerid,-1,"You have been successfully registered");
return 1;
}
}
if(dialogid == dlogin)
{
if(!response) return Kick(playerid);
if(response)
{
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass,pInfo[playerid][Pass]))
{
INI_ParseFile(Path(playerid),"loadaccount_user",.bExtra = true, .extra = playerid);
SetPlayerScore(playerid,pInfo[playerid][Scores]);
GivePlayerMoney(playerid,pInfo[playerid][Money]);
SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");
}
else
{
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");
return 1;
}
}
}
return 1;
}
So Maybe someone could help me out.. With this question..
You don't need to make code but you could explain me how it could be possible to do.
Thank you for your time.
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -
You have to add the ShowPlayerDialog in one of the dialog responses that get called, for example
Just call the next dialog in the response, and make a new dialogresponse for that, and just continue like that
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -
No, just do the ShowPlayerDialog like I showed, and then add if(dialogid == nextdialog) with the stuff you want to do in that dialog..
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -
I would do it like this, trigger the new dialog as soon as the player is done with the last one:
Re: I have problem with registration multiple dialogs.(Need some explanation or help) -