SA-MP Forums Archive
Call OnDialogResponse with CallRemoteFunction? - 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: Call OnDialogResponse with CallRemoteFunction? (/showthread.php?tid=618900)



Call OnDialogResponse with CallRemoteFunction? - parames3010 - 11.10.2016

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


Re: Call OnDialogResponse with CallRemoteFunction? - Mencent - 11.10.2016

Hello.

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


Re: Call OnDialogResponse with CallRemoteFunction? - SickAttack - 11.10.2016

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


Re: Call OnDialogResponse with CallRemoteFunction? - parames3010 - 12.10.2016

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 ?


Re: Call OnDialogResponse with CallRemoteFunction? - azzerking - 13.10.2016

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.


Re: Call OnDialogResponse with CallRemoteFunction? - Threshold - 13.10.2016

Код:
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.


Re: Call OnDialogResponse with CallRemoteFunction? - parames3010 - 13.10.2016

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