dialog input
#2

You can do this easily with ******'s sscanf plugin.

First read this for better understanding: https://github.com/Y-Less/sscanf/wiki/%22a%22-Specifier

Then you might try to do something like this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case MY_COMMAND: //the id of your command dialog
        {
            if(response) //if you pressed the first button, like "OK"
            {
                if(strlen(inputtext)) //if you entered at least 1 character
                {
                    new cmdplayers[MAX_PLAYERS], i=0;
                    sscanf(inputtext, "A<i>(-1)[MAX_PLAYERS]", cmdplayers);
                    //You put the ids you introduced in the array, and set the rest to -1 cuz 0 might be a playerid.
                    while(cmdplayers[i++]!=-1) //change for each playerid you introduced
                    {
                        //do what you have to do with the playerid
                    }
                }
            }
        }
    }
    return 1;
}
^I had no time to test this but i think i did it ok.
Reply


Messages In This Thread
dialog input - by DavidBilla - 08.06.2014, 18:44
Re: dialog input - by Koala818 - 08.06.2014, 19:03
Re: dialog input - by Konstantinos - 08.06.2014, 19:09
Re: dialog input - by Koala818 - 08.06.2014, 19:16
Re: dialog input - by Konstantinos - 08.06.2014, 19:20
Re: dialog input - by Koala818 - 08.06.2014, 19:27
Re: dialog input - by Konstantinos - 08.06.2014, 19:40
Re: dialog input - by DavidBilla - 08.06.2014, 19:45
Re: dialog input - by DavidBilla - 11.06.2014, 19:05

Forum Jump:


Users browsing this thread: 1 Guest(s)