SA-MP Forums Archive
Send dialog input text to server? - 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)
+--- Thread: Send dialog input text to server? (/showthread.php?tid=490557)



Send dialog input text to server? - MrSnapp - 27.01.2014

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.


Re: Send dialog input text to server? - Manyula - 27.01.2014

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!