Re: [CODE] stat command help

From: Mike Stilson (
Date: 01/23/03

On Thu, Jan 23, 2003 at 04:39:53PM -0800, Chris Ward wrote:
>          send_to_char(ch," Your stats are: \r\n");
-          send_to_char(ch," Str: %2d%s%s\r\n", GET_STR(ch), GET_ADD(ch));
+          send_to_char(ch," Str: %2d/%d\r\n", GET_STR(ch), GET_ADD(ch));
>          send_to_char(ch," Wis: %2d\r\n", GET_WIS(ch),(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));
-      /*    send_to_char(ch," Hitroll: %2d\r\n", points.hitroll(ch));
-          send_to_char(ch," Damroll: %d\r\n", points.damroll(ch)); */
+          send_to_char(ch," Hitroll: %2d\r\n"
+                        " Damroll: %d\r\n", GET_HITROLL(ch), GET_DAMROLL(ch));
>Im having a bit of trouble here, on another mailing list I seen something
>similar to this to show your stats, but for the life of me im not certain
>what im doing wrong. when i excute this it crashes my mud,

the macro STR_ADD() is an integer.  You were printing it with a string
format.  The compiler should've screamed about that one.  Also you were
had a mismatch with the number of argument for the format.

Pay attention to compiler warnings.  They're your friend.
(they should've been something like:
warning: format argument is not a pointer (arg 3)
warning: too few arguments for format

>I have no clue how to show the Hitroll/Damroll stuff either.

See above for the macros for hitroll/damroll.


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

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