PDA

View Full Version : Call OnDialogResponse with CallRemoteFunction?


parames3010
11/10/2016, 04:19 AM
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 :)

Mencent
11/10/2016, 06:37 AM
Hello.

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

SickAttack
11/10/2016, 06:57 AM
Write it directly if you're doing it the gamemode: OnDialogResponse(stuff here);

parames3010
12/10/2016, 11:38 PM
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 ?

azzerking
13/10/2016, 03:56 AM
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.

Threshold
13/10/2016, 08:29 AM
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

dialogid = 1913, listitem = 7...

// playerid dialogid response listitem inputtext
OnDialogResponse(playerid, 1913, 1, 7, "");

The same applies to any other native callback.

parames3010
14/10/2016, 12:25 AM
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

dialogid = 1913, listitem = 7...

// playerid dialogid response listitem inputtext
OnDialogResponse(playerid, 1913, 1, 7, "");

The same applies to any other native callback.

Thank you, it work! + Rep