Ooooh boy. I thought you where doing something else. Ignore my response :)
Davion
From: [EMAIL PROTECTED] (Atm)
To: [email protected]
Subject: Counting objects in a room
Date: Sun, 07 Dec 2003 17:50:55 -0500
Ok list. Its time to learn :-p
I was just piddling with this and want to learn how to make the
code count the number of objects (that match the argument)
and display it to the character (i know, this function is kind-of
useless but its a way for me to understand the code better)
I also know that this function is missing a chunk of code or two ;)
All im asking for is a gentle kick or shove in the right direction, maybe
some chunks of the exsisting code to look at :)
Flames, help, ect are welcome.
void do_objroom(CHAR_DATA *ch, char *argument )
{
char buf[MIL];
OBJ_DATA *obj;
OBJ_INDEX_DATA *pObjIndex;
int nMatch = 0;
int count = 0;
char arg[MSL];
if ( argument[0] == '\0' )
{
send_to_char( "You can't count nothing?\n\r", ch );
return;
}
if ( IS_NPC(ch) )
stc("Yeah, Whatever.\n\r", ch);
return;
/* insert code that counts the number *
* of (argument) that are in the room */
obj->short_descr = arg;
sprintf(buf,
"This room has (%d)%s in it\n\r",
count, arg);
stc(buf,ch);
return;
}
--
Atm of Forgotten Empire!
__________________________________________________________________
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
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca