22.10.2016, 11:41
Hello, I need to create a function that gets an item's model so I've got a question now: is there a better or faster way to do a thing like this below?
Код:
GetItemModel(item[])
{
new model;
if (!strcmp(item, "Apple")) model = ..;
else if (!strcmp(item, "Orange")) model = ..;
else if (!strcmp(item, "Bottle of Water")) model = ..;
...etc, going to have like 20 of these
return model;
}


