forward MueblesGuardados(playerid); //Muestra los muebles guardados al jugador public MueblesGuardados(playerid) { new dialog[1024], string[128]; new casa = GetPlayerDentroCasa(playerid); for(new i = 0; i < 5; i++) { new slot = HouseInfo[casa][hMueble][i]; if(slot == 0){format(string, sizeof(string), "\n{b0b0b0}%s", MuebleInfo[slot][NombreMueble]);} else{format(string, sizeof(string), "\n{FFFFFF}%s", MuebleInfo[slot][NombreMueble]);} strcat(dialog, string); SaveCasa(casa); } ShowPlayerDialog(playerid, 78, DIALOG_STYLE_LIST, "Muebles guardados", dialog, "Seleccionar", "Cerrar"); return 1; }
I am creating a furniture system and I am dealing with this problem a few days ago that has me very angry. Apparently there is no error, I checked everything and it would seem to be all right.
When opening the dialog when there is no saved piece of furniture it appears well (all the slots appear in "vacнo") but when you set some id of a piece of furniture in one or all the variables of "HouseInfo [house] [hMueble]" no dialog appears . If they could help me, I would thank them for life. Код:
forward MueblesGuardados(playerid); //Muestra los muebles guardados al jugador public MueblesGuardados(playerid) { new dialog[1024], string[128]; new casa = GetPlayerDentroCasa(playerid); for(new i = 0; i < 5; i++) { new slot = HouseInfo[casa][hMueble][i]; if(slot == 0){format(string, sizeof(string), "\n{b0b0b0}%s", MuebleInfo[slot][NombreMueble]);} else{format(string, sizeof(string), "\n{FFFFFF}%s", MuebleInfo[slot][NombreMueble]);} strcat(dialog, string); SaveCasa(casa); } ShowPlayerDialog(playerid, 78, DIALOG_STYLE_LIST, "Muebles guardados", dialog, "Seleccionar", "Cerrar"); return 1; } |
forward MueblesGuardados(playerid); //Muestra los muebles guardados al jugador
public MueblesGuardados(playerid)
{
new dialog[1024], string[128];
new casa = GetPlayerDentroCasa(playerid);
for(new i = 0; i < 5; i++)
{
new slot = HouseInfo[casa][hMueble][i];
if(slot == 0){format(string, sizeof(string), "\n{b0b0b0}%s", MuebleInfo[i][NombreMueble]);}
else{format(string, sizeof(string), "\n{FFFFFF}%s", MuebleInfo[i][NombreMueble]);}
strcat(dialog, string);
SaveCasa(casa);
}
ShowPlayerDialog(playerid, 78, DIALOG_STYLE_LIST, "Muebles guardados", dialog, "Seleccionar", "Cerrar");
return 1;
}
if(slot == 0){format(string, sizeof(string), "\n{b0b0b0}%s", /*MuebleInfo[slot][NombreMueble]*/);}
else{format(string, sizeof(string), "\n{FFFFFF}%s", /*MuebleInfo[slot][NombreMueble]*/);}
Suppose you have a piece of furniture in the house with model 19935. Then in "slot" it will store 19935.
And what you do is read "MuebleInfo [19935] [NombreMueble]" and from what I see you only get to "MuebleInfo [4] [NombreMueble]" in your furniture variable, that's why when it shows the dialog do not it does so because in theory that variable does not exist and the code will not be executed.
if(slot == 0){format(string, sizeof(string), "\n{b0b0b0}%s", /*MuebleInfo[slot][NombreMueble]*/);}
else{format(string, sizeof(string), "\n{FFFFFF}%s", /*MuebleInfo[slot][NombreMueble]*/);}