Earlier last month, I sent in a question about the who list.  In my mud, I
have corperations and gangs (2 copies of the former clan code).  Right now,
I have it so it looks like:

[110  Asian IMP  Citizen  (NoCorp) ] Tarian.

You can't be in a gang or a corp at the same time, so I wanted to make more
room for titles by having it show either a gang name or a corp name, but not
both. Sortof like:

[110  Asian IMP Ashton ] Tarian

Or:

[110  Asian IMP  Citizen ] Tarian

So I posted the question and some people wanted to see the code. So here it
is:

 /*
         * Format it up.
         */
        sprintf( buf, "[%2d %6s %s %s%s%s%s%s%s%s%s%s\n\r",
            wch->level,
            wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name
                                    : "     ",
            class,
                 clan_table[wch->clan].who_name,
                 corp_table[wch->corp].who_name,
                 wch->incog_level >= LEVEL_HERO ? "{c[Incog]{x " : "",
                 wch->invis_level >= LEVEL_HERO ? "{r[Wizi]{x " : "",
                 /*         clan_table[wch->clan].who_name, */
            IS_SET(wch->comm, COMM_AFK) ? "{YAFK{x " : "",
            IS_SET(wch->act, PLR_KILLER) ? "(KILLER) " : "",
            IS_SET(wch->act, PLR_THIEF)  ? "{R[THIEF]{x "  : "",
            wch->name,
            IS_NPC(wch) ? "" : wch->pcdata->title );
        add_buf(output,buf);
    }

The clan table is identicle to the corp table.  And one more question.  I
want to have it so that if someone is less then level 10, then there are two
spaces between the opening bracet (  [ --1 .....), greater than or equal to
10 but less than 100, to only have 1 space: (  [ -10....) and greater than
100 to have no spaces ( [ 100 .....).  Thats so that you don't get stuff
like:

[ 1  Asian IMP  Citizen  Ashton ] Tarian is tired.
[10  Asian IMP  Citizen  Ashton ] Tarian
[110  Asian IMP  Citizen  Ashton ] Tarian

I want it to be:

[ --1  Asian IMP  Citizen  Ashton ] Tarian is tired.
[ -10  Asian IMP  Citizen  Ashton ] Tarian is tired.
[110  Asian IMP  Citizen  Ashton ] Tarian is tired.

so that everything lines up. thanks a bunch. later everyone.
-tarian


Reply via email to