Call OnDialogResponse with CallRemoteFunction?
#1

hello everyone,
i want to know possible use CallRemoteFunction or CallLocalFunction for call dialog (OnDialogResponse) with dialogid xx & listitem xx ?

if possible how to write it?
please help thank you
Reply
#2

Hello.

You can call this callback but it won't show the dialog automatically.
But you can try to use CallLocalFunction or CallRemoteFunction.
Reply
#3

Write it directly if you're doing it the gamemode: OnDialogResponse(stuff here);
Reply
#4

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Write it directly if you're doing it the gamemode: OnDialogResponse(stuff here);
can you example?

how if i want call OnDialogResponse dialogid 1913 and listitem 7 ?
Reply
#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
#6

Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
dialogid = 1913, listitem = 7...

PHP код:
//                playerid    dialogid    response     listitem    inputtext
OnDialogResponse(playerid,    1913,        1,            7,            ""); 
The same applies to any other native callback.
Reply
#7

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
dialogid = 1913, listitem = 7...

PHP код:
//                playerid    dialogid    response     listitem    inputtext
OnDialogResponse(playerid,    1913,        1,            7,            ""); 
The same applies to any other native callback.
Thank you, it work! + Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)