Welcome to the Builder Academy

Question sreport (say report)

More
21 Dec 2014 18:44 #5163 by dracmas
sreport (say report) was created by dracmas
I wanted to have a report that you didn't need to be in a group for to share your health stats. Like say, but don't know how alot of things work lmao. Is it alright to use send_to_room to do so?
Code:
ACMD(do_sreport) { send_to_room(IN_ROOM(ch), "\x1B[1;32m%s reports: I have %d/%dHP, %d/%dMANA, and %d/%dMV\x1B[0;0m\r\n", GET_NAME(ch), GET_HIT(ch), GET_MAX_HIT(ch), GET_MANA(ch), GET_MAX_MANA(ch), GET_MOVE(ch), GET_MAX_MOVE(ch)); }

Please Log in or Create an account to join the conversation.

More
21 Dec 2014 20:45 #5165 by thomas
Replied by thomas on topic sreport (say report)
I suggest you use act instead. send_to_room will not hide an invisible player.
The following user(s) said Thank You: dracmas

Please Log in or Create an account to join the conversation.

More
21 Dec 2014 23:18 - 21 Dec 2014 23:24 #5166 by dracmas
Replied by dracmas on topic sreport (say report)
Thanks. It's ROMS version of it, mainly because I couldn't figure out what you meant. It works though, so thank you!
Code:
ACMD(do_sreport) { char buf[MAX_INPUT_LENGTH]; sprintf (buf, "\x1B[1;32mYou say 'I have %d/%d HP, %d/%d MANA and %d/%d MOVES.'\x1B[0;0m\r\n", GET_HIT(ch), GET_MAX_HIT(ch), GET_MANA(ch), GET_MAX_MANA(ch), GET_MOVE(ch), GET_MAX_MOVE(ch)); send_to_char (ch, buf); sprintf (buf, "\x1B[1;32m$n says 'I have %d/%d HP, %d/%d MANA and %d/%d MOVES.'\x1B[0;0m\r\n", GET_HIT(ch), GET_MAX_HIT(ch), GET_MANA(ch), GET_MAX_MANA(ch), GET_MOVE(ch), GET_MAX_MOVE(ch)); act (buf, FALSE, ch, NULL, NULL, TO_ROOM); return; }

Edit before posting: just checked. It works great for being invisible too. Nice tip. Glad you mentioned it!
Last edit: 21 Dec 2014 23:24 by dracmas. Reason: miss edit. Getting code right.

Please Log in or Create an account to join the conversation.

More
21 Dec 2014 23:40 #5167 by dracmas
Replied by dracmas on topic sreport (say report)
I do have credits on my login if it's questioned, though I think I'll find the helpfile for them so I'll be in compliance for using their code picked apart.

Please Log in or Create an account to join the conversation.

Time to create page: 0.172 seconds