Call OnDialogResponse with CallRemoteFunction?
#5

Question

Can I ask why you are manually calling OnDialogResponse ? The sa-mp process will call OnDialogResponse when you use ShowPlayerDialog.

Information

If you trying to get the results back from the dialog you have shown to a player, then you can use OnDialogResponse.

An Example:
Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
{
    if( dialogid == YOUR_DIALOG_ID ) // the second parameter you used with ShowPlayerDialog
   {
        // If you used DIALOG_STYLE_INPUT, then you need to use inputtext ( this will equal the text they entered ). If you used DIALOG_STYLE_LIST, then you need to make a switch statment like so:

        switch( listitem ) // List items start from 0, so the first item in a DIALOG LIST is 0
        {
             case 0: // The first list item
             {
                  // They selected the first item, do something with it.
             }

             case 1: // The second list item
            {
                 // They selected the second item, do something else with it.
            }
        }
   }
}
I hope this made more sense, though it was hard to understand exactly what you wanted.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)