Your index for the clan_table lookup is invalid, you probably should use a
separate function for this.  Here is the way that I'd do this:

int clan_lookup(const char *name)
{
     int clan;

     for (clan = 0; clan < MAX_CLAN; clan++)
     {
          if (!str_prefix(name, clan_table[clan].name))
               return clan;
     }
     
     return 0;
}

*snip*
if (clan != NULL)
{  
        sprintf(buf, "{R<{r<{xClan{r>{R>{x: {G%16s{x\n\r", 
        clan_table[clan_lookup(clan)].who_name );
        send_to_char(buf, ch);
}
*snip*
 
If you used a snippet for your clan system then it is quite likely that you
already have a similar clan_lookup function.  If not then the one here
should work for you, perhaps with a little modification ... you didn't give
the struct for your table so I can't be sure on that.  But regardless of how
your table is setup you can't use a string as a table index.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Saturday, November 01, 2003 6:06 AM
To: [email protected]
Subject: Question

I've stumbled upon a problem list, and im asking for help.

My problem is, im modifying a who-was (snippet on list) to let me see the
clan of offline players.  The problem is, it will not show the who list name
of the clan, just the plain name (the one you use like this "guild atm
watcher")   How do i get the who name to show up even though the player isnt
online?  

here is some code i've been fiddling with. 
char *clan;
*snip*
if ( !str_cmp( word, "Clan" ) )
            {
                clan = fread_string(fp);
                fMatch = TRUE;
                break;
            }
*snip*
if (clan != NULL)
    {
        
    sprintf(buf, "{R<{r<{xClan{r>{R>{x: {G%16s{x\n\r", 
clan_table[clan].who_name );
/* was just clan, but tried to make it show the who name here*/
        send_to_char(buf, ch);
    }

i hope i have explained myself at least enough for someone to point me in
the right direction :)   i've been at this for hours, and i dont want to
give up!  thanx in advance!
Atm, of FE

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial
today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to