14.02.2015, 23:22
Hola, hoy estaba haciendo un inventario para mi gamemode pero el problema es que al seleccionar un item de la lista no pasa nada, les dejo el cуdigo para que lo vean.
PHP код:
CMD:inventario(playerid, params[])
{
new asd[64];
format(asd, sizeof(asd), "Bebidas(s): %i\nComestibles(s): %i\nBotiquin(es): %i",Informacion[playerid][pJugo],Informacion[playerid][pPizza],Informacion[playerid][pBotiquin]);
ShowPlayerDialog(playerid, DIALOG_INVENTARIO, DIALOG_STYLE_LIST, "Tu inventario", asd, "Seleccionar", "Salir");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_INVENTARIO:
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_SED, DIALOG_STYLE_MSGBOX, "їQue deseas hacer con el objeto seleccionado?", "", "Usar", "Tirar");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_HAMBRE, DIALOG_STYLE_MSGBOX, "їQue deseas hacer con el objeto seleccionado?", "", "Usar", "Tirar");
}
case 2:
{
ShowPlayerDialog(playerid, DIALOG_BOTIQUIN, DIALOG_STYLE_MSGBOX, "їQue deseas hacer con el objeto seleccionado?", "", "Usar", "Tirar");
}
}
}
}
case DIALOG_SED:
{
if(response == 1)
{
Informacion[playerid][pSed] = 100;
SetProgressBarValue(Sed[playerid], 100);
Informacion[playerid][pJugo]--;
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.00, 0, 0, 0, 0, 0);
}
else
{
SendClientMessage(playerid, COLOR_ROJO, "Descartaste una Botella de jugo de tu inventario.");
Informacion[playerid][pPizza]--;
}
}
case DIALOG_HAMBRE:
{
if(response == 1)
{
Informacion[playerid][pHambre] = 100;
SetProgressBarValue(Hambre[playerid], 100);
Informacion[playerid][pPizza]--;
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.00, 0, 0, 0, 0, 0);
}
else
{
SendClientMessage(playerid, COLOR_ROJO, "Descartaste una Pizza de tu inventario.");
Informacion[playerid][pPizza]--;
}
}
case DIALOG_BOTIQUIN:
{
if(response == 1)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, -1, "Te haz curado");
Informacion[playerid][pBotiquin]--;
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 1, 1, 0,0);
}
else
{
SendClientMessage(playerid, COLOR_ROJO, "Descartaste un Botiquin de tu inventario.");
Informacion[playerid][pBotiquin]--;
}
}
}
return 1;
}