18.03.2013, 15:29
The first dialog shows up but the next one isn't showing. (You can see on dialog response in next peace of code)
So basicly this is the one and here is my list what I want to show in dialogs..
pawn Код:
SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTut] == 0)
{
gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
TogglePlayerControllable(playerid,0);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
SetPlayerPos(playerid, 766.50, -1684.32, -6.86);
SetPlayerCameraPos(playerid, 751.93, -1673.95, 16.01);
SetPlayerCameraLookAt(playerid, 699.55, -1628.93, 5.88);
RegistrationStep[playerid] = 2;
ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
SetPlayerVirtualWorld(playerid, 1984);
return 1;
}
return 1;
}
pawn Код:
if(dialogid == dregister1)
{
if(RegistrationStep[playerid] == 1)
{
if(response) // If they clicked 'Male' or pressed enter
{
if(strlen(inputtext))
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
splits(inputtext, DateInfo, '/');
if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
{
ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
}
new check = year - strval(DateInfo[2]);
if(check == year)
{
ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
}
if(strval(DateInfo[1]) > month)
{
check -= 1;
}
else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid][pAge] = check;
ShowPlayerDialog(playerid, dregister2, DIALOG_STYLE_LIST, "Okay. Where are you from?","Los Santos\nSan Fierro\nLiberty City\n", "Select", "Cancel");
RegistrationStep[playerid] = 2;
}
}
}
}
if (dialogid == dregister2)
{
if(RegistrationStep[playerid] == 2)
{
if (response)
{
if (listitem == 0)
{
PlayerInfo[playerid][pCity] = 0;
SendClientMessage(playerid, COLOR_GREEN, "Okay,So you are from Los Santos");
}
if (listitem == 1)
{
PlayerInfo[playerid][pCity] = 1;
SendClientMessage(playerid, COLOR_GREEN, "Okay,So you are from San Fierro");
}
if (listitem == 2)
{
PlayerInfo[playerid][pCity] = 2;
SendClientMessage(playerid, COLOR_GREEN, "Okay,So you are from Los Venturas");
}
if (listitem == 3)
{
PlayerInfo[playerid][pCity] = 3;
SendClientMessage(playerid, COLOR_GREEN, "Okay,So you are from Liberty City");
}
RegistrationStep[playerid] = 3;
}
}
return 0;
}