Player Listing Command [by Justin Robinson]
Snippet Posted Wednesday, August 12th @ 11:33:11 PM, by George Greer in the Wizard dept.
. Click the link below to read it or download it.

From: Primacy <jmrobins@wired.uvm.edu>
Subject: Player Listings

This piece of code will list out all the players in the player file.
Have fun!

In act.informative.c add:

extern struct player_index_element *player_table;
extern int top_of_p_table;

ACMD(do_players)
{
  int i, count = 0;
  *buf = 0;

  for (i = 0; i <= top_of_p_table; i++) {
    sprintf(buf, "%s  %-20.20s", buf, (player_table + i)->name);
    count++;
    if (count == 3) {
      count = 0;
      strcat(buf, "\r\n");
    }
  }
  page_string(ch->desc, buf, 1);
}

In interpreter.c add:

ACMD(do_players);

{ "players"  , POS_DEAD    , do_players  , 0, 0 },

Let me know if there are any problems with this!


<< PFile Conversion Utility (another) [by Daniel Koepke] | Reply | View as text | Flattened | Player Log File Checking [by Thomas Katzlberger] >>

 


Related Links
  Wired
download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.