if(strcmp(cmd, "/siediti", true) == 0)
{
ShowPlayerDialog(playerid, 123456, DIALOG_STYLE_LIST, "Seleziona una sedia", "Sedia in pelle\nSedia da Ristorante\nSedia in ferro\nSedia da ufficio in legno\nSedia pieghevole\nSedia con rotelle\nSedia in legno\nSedia pieghevole rossa\nSedia da ufficio in pelle\nSedia bianca", "Siediti", "Annulla");
return 1;
}
#define 123456 1
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 123456:
{
if (!response) return 0;
if(response)
{
//Do something here, by send the player a message or maybe put a marker on their radar, anything here.
}
}
}
return 1;
}
else if(dialogid == 123456 && response)
{
switch(listitem)
{
case 0:
{
SetPlayerAttachedObject(playerid, 1, 1671, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 1:
{
SetPlayerAttachedObject(playerid, 1, 1720, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 2:
{
SetPlayerAttachedObject(playerid, 1, 1721, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 3:
{
SetPlayerAttachedObject(playerid, 1, 1811, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 4:
{
SetPlayerAttachedObject(playerid, 1, 1810, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 5:
{
SetPlayerAttachedObject(playerid, 1, 1806, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 6:
{
SetPlayerAttachedObject(playerid, 1, 2120, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 7:
{
SetPlayerAttachedObject(playerid, 2121, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 8:
{
SetPlayerAttachedObject(playerid, 1, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 9:
{
SetPlayerAttachedObject(playerid, 1, 1714, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 10:
{
SetPlayerAttachedObject(playerid, 1, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
}
}
else if(dialogid == 8 && response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"Lavori Disponibili","Meccanico\nSpazzino\nCamionista\nPizzaBoy\nGelataio\nAgricoltore\nPostino\nOperaio\nTaxista","Ok","Indietro");
}
case 1:
{
ShowPlayerDialog(playerid,91,DIALOG_STYLE_LIST,"Concessionari","Concessionaria Auto Sportive\nConcessionaria Auto Normali\nConcessionaria Moto\nConcessionaria Barche\nConcessionaria Aerei","Ok","Indietro");
}
case 2:
{
ShowPlayerDialog(playerid,92,DIALOG_STYLE_LIST,"Posti Comuni","Distretto di Polizia\nOspedale\nSupermercato\nBanca\nNegozio Vestiti\nStazione\nScuola Guida\nComune\nCentro Assicurazioni\nCentro Targhe","Ok","Indietro");
}
}
}
|
I wrote # define DIALOG 123456, and I made it out, but it gives me the same result.
In ondialogresponse I write this. I do not know if it's okay Код:
else if(dialogid == 123456 && response)
{
switch(listitem)
{
case 0:
{
SetPlayerAttachedObject(playerid, 1, 1671, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 1:
{
SetPlayerAttachedObject(playerid, 1, 1720, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 2:
{
SetPlayerAttachedObject(playerid, 1, 1721, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 3:
{
SetPlayerAttachedObject(playerid, 1, 1811, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 4:
{
SetPlayerAttachedObject(playerid, 1, 1810, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 5:
{
SetPlayerAttachedObject(playerid, 1, 1806, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 6:
{
SetPlayerAttachedObject(playerid, 1, 2120, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 7:
{
SetPlayerAttachedObject(playerid, 2121, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 8:
{
SetPlayerAttachedObject(playerid, 1, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 9:
{
SetPlayerAttachedObject(playerid, 1, 1714, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
case 10:
{
SetPlayerAttachedObject(playerid, 1, 1765, 1, -0.800000, 0.000000, -0.500000, 180.000000, 90.000000, 0.000000);
ApplyAnimation(playerid,"PED","SEAT_down",4.1,0,1,1,1,0);
animation[playerid] = 1;
}
}
}
else if(dialogid == 8 && response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"Lavori Disponibili","Meccanico\nSpazzino\nCamionista\nPizzaBoy\nGelataio\nAgricoltore\nPostino\nOperaio\nTaxista","Ok","Indietro");
}
case 1:
{
ShowPlayerDialog(playerid,91,DIALOG_STYLE_LIST,"Concessionari","Concessionaria Auto Sportive\nConcessionaria Auto Normali\nConcessionaria Moto\nConcessionaria Barche\nConcessionaria Aerei","Ok","Indietro");
}
case 2:
{
ShowPlayerDialog(playerid,92,DIALOG_STYLE_LIST,"Posti Comuni","Distretto di Polizia\nOspedale\nSupermercato\nBanca\nNegozio Vestiti\nStazione\nScuola Guida\nComune\nCentro Assicurazioni\nCentro Targhe","Ok","Indietro");
}
}
}
|
#define DIALOG 123456
For what you're doing is your supposed to put this
#define 123456 1
if(strcmp(cmd, "/siediti", true) == 0)
{
ShowPlayerDialog(playerid, DIALOG_A, DIALOG_STYLE_LIST, "Seleziona una sedia", "Sedia in pelle\nSedia da Ristorante\nSedia in ferro\nSedia da ufficio in legno\nSedia pieghevole\nSedia con rotelle\nSedia in legno\nSedia pieghevole rossa\nSedia da ufficio in pelle\nSedia bianca", "Siediti", "Annulla");
return 1;
}
ShowPlayerDialog(playerid, 123456, DIALOG_STYLE_LIST, "Seleziona una sedia", "Sedia in pelle\nSedia da Ristorante\nSedia in ferro\nSedia da ufficio in legno\nSedia pieghevole\nSedia con rotelle\nSedia in legno\nSedia pieghevole rossa\nSedia da ufficio in pelle\nSedia bianca", "Siediti", "Annulla");