PDA

View Full Version : Dialog help


Youice
04/04/2012, 05:58 PM
Hello here is my problem ::

after I connect and fill in my age & sex info. it kicks me here is the code::


if(dialogid == DIALOG_AGE)
{
if(!response)
{
Kick(playerid);
}
else
{
if(strlen(inputtext))
{
new age = strval(inputtext);
if(age > 100 || age < 16)
{
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
else
{
PlayerInfo[playerid][pAge] = age;
new
string[ 64 ]
;
format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
SendClientMessage(playerid, -1, string);
SpawnPlayer(playerid);
new file[100];
dini_Create(file);
dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
}
}
else
{
return 0;
}
}
}
if(dialogid == DIALOG_SEX)
{
if(!response)
{
Kick(playerid);
}
if(strlen(inputtext))
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 60);
PlayerInfo[playerid][pSkin] = 60;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
else
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 233);
PlayerInfo[playerid][pSkin] = 233;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
}

.FuneraL.
04/04/2012, 06:11 PM
if(dialogid == DIALOG_AGE)
{
if(!response)
{
Kick(playerid);
}
else
{
if(strlen(inputtext))
{
new age = strval(inputtext);
if(age > 100 || age < 0)
{
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 0 - 100 ))","Answer","Quit");
}
else
{
PlayerInfo[playerid][pAge] = age;
new
string[ 64 ]
;
format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
SendClientMessage(playerid, -1, string);
SpawnPlayer(playerid);
new file[100];
dini_Create(file);
dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
}
}
else
{
return 0;
}
}
}
if(dialogid == DIALOG_SEX)
{
if(!response)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Change Your Sex!", pname);
}
if(strlen(inputtext))
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 60);
PlayerInfo[playerid][pSkin] = 60;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
else
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 233);
PlayerInfo[playerid][pSkin] = 233;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 0 - 100 ))","Answer","Quit");
}
}

Try This

Youice
04/04/2012, 06:14 PM
Still same problem you only changed the number of " 16 " minimum to " 0 " minimum , any way thank you for trying

Youice
04/04/2012, 07:43 PM
any help :D ?

BrandyPenguin
04/04/2012, 08:57 PM
Show how to you open your dialog? Maybe your responding is conflict with displaying.

jaheem
04/04/2012, 09:12 PM
hop this work

if(dialogid == DIALOG_AGE)
{
if(response)
{
new age = strval(inputtext);
if(age < 16 || age > 100)
{
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 16 - 100 ))","Answer","Quit");
return 1;
}
else
{
new string[ 64 ]
;
format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
SendClientMessage(playerid, -1, string);
SpawnPlayer(playerid);
new file[100];
dini_Create(file);
dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
return 1;
}
}
else
{
Kick(playerid);
return 1;
}
}
if(dialogid == DIALOG_SEX)
{
if(response)
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 60);
PlayerInfo[playerid][pSkin] = 60;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
else
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
SetPlayerSkin(playerid, 233);
PlayerInfo[playerid][pSkin] = 233;
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
}
}