[help] Dialog Register - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [help] Dialog Register (
/showthread.php?tid=214189)
[help] Dialog Register -
NO.L3O - 20.01.2011
See a have this problem with my dialog carather register i made an DIALOG_STLY_INPUT for Male/Female i ihave it ses thet male/female is not inplanted here is the code
Код:
if(dialogid == 3) // Spol
{
if(RegistrationStep[playerid] == 1)
{
if(strlen(inputtext == male)) // if player Male
{
PlayerInfo[playerid][pSex] = 1;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
new musko;
musko = random(sizeof(CivMalePeds));
SetPlayerSkin(playerid, musko);
PlayerInfo[playerid][pChar] = musko;
}
if(strlen(inputtext == zensko)) // if player female
{
PlayerInfo[playerid][pSex] = 2;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
}
if(strlen(inputtext )) // if input text is not MALE or FEMALE
{
SendClientMessage(playerid, -1, ""#COL_RED"-ERR-:"#COL_WHITE" Upiљi musko ili zensko");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Kojeg ste spola? [ INGAME ]","Ok!", "Exit");
}
if(listitem == 0) // Kick
{
Kick(playerid);
}
return 1;
}
}
I Try this
Код:
if(dialogid == 3) // Spol
{
if(RegistrationStep[playerid] == 1)
{
new male;
new female;
if(strlen(inputtext == male)) // if player Male
{
PlayerInfo[playerid][pSex] = 1;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
new musko;
musko = random(sizeof(CivMalePeds));
SetPlayerSkin(playerid, musko);
PlayerInfo[playerid][pChar] = musko;
}
if(strlen(inputtext == zensko)) // if player female
{
PlayerInfo[playerid][pSex] = 2;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
}
if(strlen(inputtext )) // if input text is not MALE or FEMALE
{
SendClientMessage(playerid, -1, ""#COL_RED"-ERR-:"#COL_WHITE" Upiљi musko ili zensko");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Kojeg ste spola? [ INGAME ]","Ok!", "Exit");
}
if(listitem == 0) // Kick
{
Kick(playerid);
}
return 1;
}
}
But stil the same
TNX for help
Re: [help] Dialog Register -
ikkentim - 20.01.2011
use STYLE_LIST after that you can use the 'listitem' var from the OnDialogResponse to see if its a male / female. (listitem== 0 / listitem==1 )
Re: [help] Dialog Register -
NO.L3O - 21.01.2011
No a dont wont to use stly list becouse all server ( ROLePLAY ) are using DIALOG_STLYE_LIST
Re: [help] Dialog Register -
NO.L3O - 21.01.2011
Plz help
Re: [help] Dialog Register -
NO.L3O - 21.01.2011
help need
Re: [help] Dialog Register -
NO.L3O - 21.01.2011
pleas help !
Re: [help] Dialog Register -
Sascha - 21.01.2011
pawn Код:
if(dialogid == 3) // Spol
{
if(RegistrationStep[playerid] == 1)
{
new male;
new female;
if(!strcmp(inputtext, "male", true)) // if player Male
{
PlayerInfo[playerid][pSex] = 1;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
new musko;
musko = random(sizeof(CivMalePeds));
SetPlayerSkin(playerid, musko);
PlayerInfo[playerid][pChar] = musko;
}
if(!strcmp(inputtext, "zensko", true)) // if player female
{
PlayerInfo[playerid][pSex] = 2;
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Koliko imate godina? [ INGAME ]", "17\n"#COL_BLUE"18\n"#COL_WHITE"19\n"#COL_BLUE"20\n"#COL_WHITE"21\n"#COL_BLUE"22\n"#COL_WHITE"23\n"#COL_BLUE"24\n"#COL_WHITE"25\n"#COL_BLUE"26\n"#COL_WHITE"27\n"#COL_BLUE"28\n"#COL_WHITE"29\n"#COL_BLUE"30\n"#COL_WHITE"31", "Ok!", "Exit");
RegistrationStep[playerid] = 2;
}
else // if input text is not MALE or FEMALE
{
SendClientMessage(playerid, -1, ""#COL_RED"-ERR-:"#COL_WHITE" Upiši musko ili zensko");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Kojeg ste spola? [ INGAME ]","Ok!", "Exit");
}
if(!strlen(inputtext)) // Kick
{
Kick(playerid);
}
return 1;
}
}
try this...
if it doesn't work add me on msn (send me a PM for the email addresse)...
"strlen" returns then text lengths of a work... e.g. if you enter "male" and use "strlen(inputtext)" then it would return "5".... if you want to compare a string to another string then you have to use strcmp