14.07.2012, 13:15
Hi everyone, im sitting here with one problem, when i make dialog(gun menu etc) then how do i make categories? like for guns i want to make shotguns, SMG's etc, how do i make it?
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dialogid) //If they responded to our dialog
{
if(response) // If they pressed the Okay button.
{
switch(listitem) //Start using list items, like Category 1, 2, 3 etc.
{
case 0: //If they chose Category 1
{
//Do something here.
}
case 1: //If they chose Category 2
//Code Continues...
ShowPlayerDialog(playerid, dialogid, style, "Dialog Title", "Category 1\nCategory 2\nCategory 3","Okay","Exit");
Use '\n' to separate categories, Category 1 becomes case 0. Category 2 becomes case 1. Category 3 becomes case 2. So when you call OnDialogResponse, use case to define categories. Example: pawn Код:
|