Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Running the server ➜ Help with WHO?

Help with WHO?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Saint   (16 posts)  Bio
Date Wed 30 Mar 2005 04:47 PM (UTC)
Message
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!
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 30 Mar 2005 06:39 PM (UTC)
Message
Don't forget to use the code tag. ;)

I don't think it's really possible. The size of the line buffer does not depend on the mud, it depends on the client the player is using. So the "center" would only depend on the client, which the mud can't read from.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Saint   (16 posts)  Bio
Date Reply #2 on Wed 30 Mar 2005 07:26 PM (UTC)
Message
Alright, gotcha on that. My WHO currently looks like this.

**************************
Charmed


--=-=-=-= Mortals =-=-=-=--

[ Human ] Demitri the Pilferer

Players found: 1 Immortals found : 0

***************************

Now this is all aligned to the left side of my screen. Is there anyway I can edit it to make it look like its centered? Perhaps take away the [ Human ] thing next to the persons name? Thanks.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,383 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.