Dialog help -
RLGaming - 25.10.2012
pawn Код:
if(fexist(UserSavePath(playerid)))
{
format(string1, sizeof(string1), "Hello %s, welcome back!", GetPlayerNameEx(playerid));
format(string2, sizeof(string2), "Welcome back %s, to "GM_NAME"! We have found your account registered in the database.\n\nEnter your password to login!", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string1, string2, "Login!", "Cancel");
}
else
{
format(string1, sizeof(string1), "Hello there %s!", GetPlayerNameEx(playerid));
format(string2, sizeof(string2), "Welcome %s to "GM_NAME", it seem's you have not registered yet!\n\nEnter your desired password below to do so!", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, string1, string2, "Register!", "Cancel");
}
I have this when I start up, it shows the register one since im not registered
then
pawn Код:
if(dialogid == DIALOG_REGISTER)
{
if(!response) return Kick(playerid);
if(response)
{
if(strlen(inputtext) > 5)
{
new string[96];
format(string, sizeof(string), "%s, choose your gender!", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTERGENDER, DIALOG_STYLE_LIST, string, "1) I am a male.\n2) I am a female.", "Select", "Cancel");
new INI:File = INI_Open(UserSavePath(playerid));
INI_WriteInt(File, "Password", strlen(inputtext));
INI_WriteInt(File, "Level", PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Administration", PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "VIP Level", PlayerInfo[playerid][pVIP] = 0);
INI_WriteInt(File, "Skin ID", PlayerInfo[playerid][pSkinID] = 299);
INI_WriteInt(File, "Playing Hours", PlayerInfo[playerid][pConnectTime] = 0);
INI_WriteInt(File, "House Key", PlayerInfo[playerid][pHouseKey] = -1);
INI_WriteInt(File, "Kills", PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File, "Deaths", PlayerInfo[playerid][pDeaths] = 0);
INI_Close(File);
}
}
}
My register response, it ini writes it etc, but after I enter a password to register it will give me the login dialog not the gender one, so any help?
Re: Dialog help -
Faisal_khan - 25.10.2012
Weird. Check if
pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string1, string2, "Login!", "Cancel");
is there again in your code somewhere.
Re: Dialog help -
RedJohn - 25.10.2012
Код:
if(dialogid == DIALOG_REGISTER)
{
if(!response) return Kick(playerid);
if(response)
{
if(strlen(inputtext) > 5)
{
new INI:File = INI_Open(UserSavePath(playerid));
INI_WriteInt(File, "Password", strlen(inputtext));
INI_WriteInt(File, "Level", PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Administration", PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "VIP Level", PlayerInfo[playerid][pVIP] = 0);
INI_WriteInt(File, "Skin ID", PlayerInfo[playerid][pSkinID] = 299);
INI_WriteInt(File, "Playing Hours", PlayerInfo[playerid][pConnectTime] = 0);
INI_WriteInt(File, "House Key", PlayerInfo[playerid][pHouseKey] = -1);
INI_WriteInt(File, "Kills", PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File, "Deaths", PlayerInfo[playerid][pDeaths] = 0);
INI_Close(File);
new genderstring[96];
format(genderstring, sizeof(genderstring), "%s, choose your gender!", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTERGENDER, DIALOG_STYLE_LIST, genderstring, "1) I am a male.\n2) I am a female.", "Select", "Cancel");
}
}
}
Maybe it will work.
Re: Dialog help -
RLGaming - 25.10.2012
Didn't fix it;/, still says login straight after register
Re: Dialog help -
RLGaming - 25.10.2012
Anyone please? ;/