I actually did something different. I used my coding skills
Code:
else if (!str_cmp(field, "players_inzone")) {
if (subfield && *subfield) {
struct descriptor_data *d;
char zone_bot[READ_SIZE], zone_top[READ_SIZE], num_allowed[READ_SIZE];
int inzone = 0;
three_arguments(subfield, zone_bot, zone_top, num_allowed);
for (d = descriptor_list; d; d = d->next) {
if (!STATE(d) && IN_ROOM(d->character) >= real_room(atoi(zone_bot)) &&
IN_ROOM(d->character) <= real_room(atoi(zone_top)) && GET_LEVEL(d->character) < LVL_IMMORT
inzone++;
}
if (inzone >= atoi(num_allowed))
snprintf(str, slen, "1");
else
snprintf(str, slen, "0");
}
}
else if (!str_cmp(field, "zonenumber"))
snprintf(str, slen, "%d", zone_table[r->zone].number);
else if (!str_cmp(field, "zonename"))
snprintf(str, slen, "%s", zone_table[r->zone].name);
else if (!str_cmp(field, "roomflag")) {
Wallah! No longer need to do a search into every room. I was worried that if you came across a room that did not exist in VNUM order, it would crash. I tried something different and works like a charm. I would not have thought outside of the box if not for Rumble's example above.