PDA

View Full Version : how to make serach in dialog ?


_Application_
27/01/2015, 12:22 PM
How do I search system in the dialog?

Stanford
27/01/2015, 12:23 PM
Be specific so we can help you properly!.

dionisak0s
27/01/2015, 12:27 PM
I think he wants to make a system where you may search something in a dialog by just typing something on an input dialog

_Application_
27/01/2015, 12:27 PM
Be specific so we can help you properly!.

Array with all objects,

Appears in DIALOG_STYLE_INPUT

And, for example, I write in the box,
DOOR

Then it will show all objects dialogue whose names start at DOOR



sorry my bad english ,

I think he wants to make a system where you may search something in a dialog by just typing something on an input dialog


yess !

Gammix
27/01/2015, 12:32 PM
Use this anywhere to show a search dialog:
ShowPlayerDialog(playerid, DIALOG_ID_HERE, DIALOG_STYLE_INPUT, "Search Dialog:", "The content here!", "Search", "Cancel");


Now, for functionality of the dialog, use this:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ID_HERE)
{
if(response)
{
if(! strcmp(inputtext, "example text"))
{
//if you want the inputext match with the specified text completely!
}

if(! strfind(inputtext, "example text"))
{
//if you want the inputtext be relative to the specified text!
}
}
}
return 1;
}

According to your words, this is what i think you want.

_Application_
27/01/2015, 05:00 PM
Use this anywhere to show a search dialog:
ShowPlayerDialog(playerid, DIALOG_ID_HERE, DIALOG_STYLE_INPUT, "Search Dialog:", "The content here!", "Search", "Cancel");


Now, for functionality of the dialog, use this:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ID_HERE)
{
if(response)
{
if(! strcmp(inputtext, "example text"))
{
//if you want the inputext match with the specified text completely!
}

if(! strfind(inputtext, "example text"))
{
//if you want the inputtext be relative to the specified text!
}
}
}
return 1;
}

According to your words, this is what i think you want.

I want it to be with an array of all the objects...

_Application_
28/01/2015, 05:09 PM
help please?