15.04.2015, 20:25
Do it like this, so you only have to add a new element in the array when you want to expand your furniture list, doing it manually (like you're doing) makes no sense, and it's hard to read.
PHP код:
enum e_furn
{
furnimodel
furniname[32],
furnicost
}
new FurnitureArray[][e_furn] =
{
//
// Model, name, cost
//
{1337, "Trash Bin", 100}
};
//
// Showing the dialog
//
new dialog[1024]; // It has to be large
for(new i = 0; i != sizeof FurnitureArray; i++)
{
format(dialog, sizeof dialog, "%s ($%d)\n%s", FurnitureArray[i][furniname], FurnitureArray[i][furnicost], dialog);
}
// Now just show this dialog
//
// Processing the dialog (this OnDialogResponse)
//
printf("You selected furniture model %d (name: %s)", FurnitureArray[listitem][furnimodel] ,FurnitureInfo[listitem][furniname]);