30 Nov, 2008, Sharmair wrote in the 21st comment:
Votes: 0
Igabod said:
so this
if (ch->hitroll < 1001)
sprintf(arg, "%d", (ch->hitroll / 8) + 1);
strcat (buf, "\n\r{cHitroll{W: {mCost is ");
strcat (buf, arg);
strcat (buf, " trains per point{x");
if (ch->damroll < 1001)
sprintf(arg, "%d", (ch->damroll / 8) +1);
strcat (buf, "\n\r{cDamroll{W: {mCost is ");
strcat (buf, arg);
strcat (buf, " trains per point{x");

should look like this:
if (ch->hitroll < 1001)
sprintf(buf+strlen(buf), "\n\r{cHitroll{W: {mCost is %d trains per point{x", (ch->hitroll / 8) + 1));
if (ch->damroll < 1001)
sprintf(buf+strlen(buf), "\n\r{cDamroll{W: {mCost is %d trains per point{x, (ch->damroll / 8) + 1));

at least thats what i'm understanding, correct me if i'm wrong

To make the first method work, you will need to add the arg buffer to the start of the function like:
char arg[MAX_INPUT_LENGTH];

And add the brackets like I had.

The second method here should work like you have it, and, even though it might be the hardest to
understand how it works of the three methods I have shown so far, I think I would use is as it is only
one line after the if and takes no added buffer.
30 Nov, 2008, Igabod wrote in the 22nd comment:
Votes: 0
yay that got it, for anybody who is looking at this for help with their own muds though i should point out that i put too man )'s at the end of line 2 and 4 it should be just the one.

thank you very much for all the assistance sharmair
20.0/22