Send dialog input text to server?
#1

Hello there,

I was testing out dialog registers and I could not figure out how to send the text that was inputted into the dialog to the server instead of having to type it in manually when pressing 'T'.

Instead of typing male manually it's inputted into a dialog box. How do I submit that dialog input to the server before carrying onto the next dialog?

Any help appreciated.

pawn Код:
ShowPlayerDialog(playerid,DIALOG_CPROFILE, DIALOG_STYLE_INPUT, "Gender", "Enter your gender below: (Type male or female)", "Continue", "Cancel");
pawn Код:
if(dialogid == DIALOG_CPROFILE) //
    {
        if(response)
        {
           
        }
    }
pawn Код:
if(RegistrationStep[playerid] == 1)
        {
            if(sscanf(text, "s[10]", tmp)) return 0;
            if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
            {
                PlayerInfo[playerid][pSex] = 1;
                SCM(playerid, COLOR_YELLOW2, "You selected male.");
                ShowPlayerDialog(playerid,DIALOG_CPROFILE, DIALOG_STYLE_INPUT, "Age", "Enter your birthdate below: (Use dd/mm/yyyy)", "Continue", "Cancel");
                new maleskin;
                maleskin = random(sizeof(CivMalePeds));
                SetPlayerSkin(playerid, maleskin);
                PlayerInfo[playerid][pChar] = maleskin;
                RegistrationStep[playerid] = 2;
                return 0;
            }
Yes I am playing around with Ravens RP; eventually starting from scratch.
Reply
#2

I'm sure you can do this on your own. Here's something to go on.
Take a look at your Code block an remove all lines that belong to a string comparison, or accordingly a manually written command.
If you're doing the dialog thing, you are forcing to complete the registration step by step, so I'd say you don't need to check on which RegistrationStep the player is.
I suppose your 'Gender' Dialog does not require a second button, so you leave it out. To list the genders, just use listitems (DIALOG_STYLE_LIST, you can look everything up in the wiki). In order to open the next Dialog, just insert another ShowPlayerDialog unter '(response)', at the bottom.

I hope this helped!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)