[help] Dialog Register
#1

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
Reply
#2

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 )
Reply
#3

No a dont wont to use stly list becouse all server ( ROLePLAY ) are using DIALOG_STLYE_LIST
Reply
#4

Plz help
Reply
#5

help need
Reply
#6

pleas help !
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)