Re: [CODE] showstats command help

From: Greg Buxton (
Date: 01/23/03

We'll do this in reverse order to help give some sense to this.

> Im looking for some coding help here, I seen something similar to this
> posted on another mailing list, and I tried to implement it into my 3.1
> mud. Everytime I excute it, my mud crashes. I have no clue whats wrong, I
> just wanted to print out these stats to a player when they want to see

The code helped to figure out the problem, but it also helps when you also
provide a bit more information.  gdb info from the crash, etc.

But, based off the code we'll assume you're new to both the Circle list
and to C code in general, so let's take a look at each line, one at a time.

> ACMD(do_yummy)
> {
>            send_to_char(ch," Your stats are: \r\n");

So far so good.

>            send_to_char(ch," Str: %2d%s%s\r\n", GET_STR(ch), GET_ADD(ch));

You've got three format chars '%2d%s%s' and are giving it two numeric

This isn't conductive to a happy compiler.


  send_to_char(ch, " Str: %2d/%2d\r\n", GET_STR(ch), GET_ADD(ch));

>            send_to_char(ch," Wis: %2d\r\n", GET_WIS(ch),(ch));

You've got one format char, but are giving it two arguments, a number and
a struct char_data structure for the character (ch).


  send_to_char(ch, " Wis: %2d\r\n", GET_WIS(ch));

>            send_to_char(ch," Con: %2d\r\n", GET_CON(ch));
>            send_to_char(ch," Dex: %2d\r\n", GET_DEX(ch));
>            send_to_char(ch," Int: %2d\r\n", GET_INT(ch));
>            send_to_char(ch," Cha: %2d\r\n", GET_CHA(ch));

All good there.

>            send_to_char(ch," Hitroll: %2d\r\n", points.hitroll(ch));


  send_to_char(ch, " Hitroll: %d\r\n", GET_HITROLL(ch));

>            send_to_char(ch," Damroll: %d\r\n", points.damroll(ch));


  send_to_char(ch, " Damroll: %d\r\n", GET_DAMROLL(ch));

> }

- Greg
Shadows of Amber 5200

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT