Alright guys. I fixed up my WHO list to the way I wanted it, however theres one small problem. I cant get it to center. Ugh this is annoying. I really want the WHO to display in the center of the screen. Any ideas? Heres my WHO code.
-----------------------------------------------------
void do_who (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
BUFFER *output;
DESCRIPTOR_DATA *d;
int wlevel;
int nMatch;
int iMatch;
bool imm = FALSE;
bool mor = FALSE;
sprintf (buf, "\n\r {RC{rharmed{x\n\r\n\r");
send_to_char(buf, ch);
nMatch = 0;
iMatch = 0;
buf[0] = '\0';
output = new_buf ();
for ( wlevel=MAX_LEVEL; wlevel>0; wlevel-- )
{
for (d = descriptor_list; d != NULL; d = d->next)
{
CHAR_DATA *wch;
if (d->connected != CON_PLAYING || !can_see (ch, d->character))
continue;
wch = (d->original != NULL) ? d->original : d->character;
if( wch->level != wlevel )
continue;
if (wch->level >= 52)
imm = TRUE;
if (wch->level <= 51)
mor = TRUE;
if (!can_see (ch, wch))
continue;
}
}
if (imm)
{
sprintf (buf, " {R--{r={R-{r={R-{r={R-{r= {DImmortals {r={R-{r={R-{r={R-{r={R--{W{X\n\r\n\r");
send_to_char(buf, ch);
}
for ( wlevel=MAX_LEVEL; wlevel>0; wlevel-- )
{
for (d = descriptor_list; d != NULL; d = d->next)
{
CHAR_DATA *wch;
if (d->connected != CON_PLAYING || !can_see (ch, d->character))
continue;
wch = (d->original != NULL) ? d->original : d->character;
if( wch->level != wlevel )
continue;
if (!can_see (ch, wch))
continue;
if (wch->level < 52)
continue;
iMatch++;
sprintf (buf, "{m[ {x%6s {m]{x %s%s%s%s%s%s%s%s{X\n\r",
wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name
: " ",
wch->incog_level >= LEVEL_HERO ? "(Incog) " : "",
wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "",
clan_table[wch->clan].who_name,
IS_SET (wch->comm, COMM_AFK) ? "[AFK] " : "",
IS_SET (wch->act, PLR_KILLER) ? "(KILLER) " : "",
IS_SET (wch->act, PLR_THIEF) ? "(THIEF) " : "",
wch->name, IS_NPC (wch) ? "" : wch->pcdata->title);
add_buf (output, buf);
}
}
if (mor)
{
sprintf (buf, "\n\r {R--{r={R-{r={R-{r={R-{r= {D Mortals {r={R-{r={R-{r={R-{r={R--{W{X\n\r\n\r");
add_buf (output, buf);
}
for ( wlevel=MAX_LEVEL; wlevel>0; wlevel-- )
{
for (d = descriptor_list; d != NULL; d = d->next)
{
CHAR_DATA *wch;
if (d->connected != CON_PLAYING || !can_see (ch, d->character))
continue;
wch = (d->original != NULL) ? d->original : d->character;
if( wch->level != wlevel )
continue;
if (!can_see (ch, wch))
continue;
if (wch->level > 52)
continue;
nMatch++;
sprintf (buf, "{m[ {x%6s {m]{x %s%s%s%s%s%s%s%s{X\n\r",
wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name
: " ",
wch->incog_level >= LEVEL_HERO ? "(Incog) " : "",
wch->invis_level >= LEVEL_HERO ? "(Wizi) " : "",
clan_table[wch->clan].who_name,
IS_SET (wch->comm, COMM_AFK) ? "[AFK] " : "",
IS_SET (wch->act, PLR_KILLER) ? "(KILLER) " : "",
IS_SET (wch->act, PLR_THIEF) ? "(THIEF) " : "",
wch->name, IS_NPC (wch) ? "" : wch->pcdata->title);
add_buf (output, buf);
}
}
sprintf (buf, "\n\rPlayers found: {R%d{w Immortals found : {R%d{w\n\r", nMatch, iMatch);
add_buf (output, buf);
page_to_char (buf_string (output), ch);
free_buf (output);
return;
}
---------------------------------------------------------
And thats it. Any help would be much appreciated! |