[code] list of rooms...

From: ;P (siv@CYBERENET.NET)
Date: 07/22/97

hey...i figured that it would be useful to be able to get a list of the
rooms in a zone...so that you know which ones have been used or whatever..
i have it mostly working, but for some reason, it doesn't work completely..
if i type "rooms 20"...it will list the rooms for zone 68...if i type
"rooms 30" it will give me the rooms for zone 99...i think this has to do
with real numbers vs virtual numbers, but i think that i have everything
correct...anyway...here's the code...use it if you want or whatever...let
me know if you see anything wrong...



 int znum = 0,i;
 extern int top_of_world;

 one_argument(argument, arg);

 if (!*arg) {
   send_to_char("Usage: rooms <zone number>\r\n", ch);
   return; }

 if (isdigit(*arg))
    znum = atoi(arg);
    for (i = 0; i < top_of_world; i++)
      if (world[i].zone == znum)
        sprintf(buf, " [%d] %s\r\n", world[i].number, world[i].name);
        send_to_char(buf, ch);
  } else
  send_to_char("You must supply a zone number.\r\n", ch);



     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |

This archive was generated by hypermail 2b30 : 12/08/00 PST