I have 141 items to add to this list, is there a quicker or better way?
#8

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 0!= sizeof FurnitureArrayi++)
{
    
format(dialogsizeof 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]); 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)