27.10.2017, 14:26
include used: https://sampforum.blast.hk/showthread.php?tid=570213
check the images below
1 - The normal code is that, can you see objects in list and spawning the object normally.
https://i.imgur.com/gxFyJWJ.png
2 - This code is modified as I want, but different from the above code, is not spawning the objects.
When click on the object to spawn, it just closes the dialog.
https://i.imgur.com/Ldf8gli.png
check the images below
1 - The normal code is that, can you see objects in list and spawning the object normally.
https://i.imgur.com/gxFyJWJ.png
PHP код:
Dialog:FurniturePurchase2(playerid, response, listitem, inputtext[])
{
if(!response) return Dialog_Show(playerid, FurniturePurchase, DIALOG_STYLE_LIST, "Selecione uma categoria de mуveis", GetHouseCategoryList(), "Selecionar", "Cancelar");
gstr[0] = EOS;
strcat(gstr, "Nome da mobнlia\tCusto\n");
for(new x = 0; x < MAX_FURNITURE; x++)
{
if(FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid, "FurnCat") && FurniData[x][fModel] != 0)
{
format(sgstr, sizeof(sgstr), "%s\t$%s\n", FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
strcat(gstr, sgstr);
}
}
Dialog_Show(playerid, FurniturePurchase3, DIALOG_STYLE_TABLIST_HEADERS, "Comprar mуveis", gstr, "Selecionar", "Cancelar");
return true;
}
When click on the object to spawn, it just closes the dialog.
https://i.imgur.com/Ldf8gli.png
PHP код:
Dialog:FurniturePurchase2(playerid, response, listitem, inputtext[])
{
if(!response) return Dialog_Show(playerid, FurniturePurchase, DIALOG_STYLE_LIST, "Selecione uma categoria de mуveis", GetHouseCategoryList(), "Selecionar", "Cancelar");
gstr[0] = EOS;
strcat(gstr, "Nome da mobнlia\tCusto\n");
for(new x = 0; x < MAX_FURNITURE; x++)
{
if(FurniData[x][fSubCategory] == listitem && FurniData[x][fCategory] == GetPVarInt(playerid, "FurnCat") && FurniData[x][fModel] != 0)
{
format(sgstr, sizeof(sgstr), "%i\t%s~n~$%s\n", FurniData[x][fModel], FurniData[x][fuName], format_cash(FurniData[x][fPrice]));
strcat(gstr, sgstr);
}
}
ShowPlayerDialog(playerid, FurniturePurchase3, DIALOG_STYLE_PREVIEW_MODEL, "Comprar mуveis", gstr, "Selecionar", "Cancelar");
return true;
}


