Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Wizcommands/commands and how to get them to display levels?
Wizcommands/commands and how to get them to display levels?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Turmoil
(5 posts) Bio
|
Date
| Wed 12 Dec 2001 09:03 AM (UTC) |
Message
| I have my slist that brings up skills with their levels next to them. I immed at one mud where their wizcommands displayed the imm levels and the wizcommands that you got at that level. I'm very new to mud coding and I'm not quite sure what all the variables mean so I'm having a lot of problems. My do wizcommand look like this.
void do_wizhelp( CHAR_DATA *ch, char *argument )
{
CMDTYPE * cmd;
int col, hash;
col = 0;
set_pager_color( AT_PLAIN, ch );
for ( hash = 0; hash < 126; hash++ )
for ( cmd = command_hash[hash]; cmd; cmd = cmd->next )
if ( cmd->level >= LEVEL_HERO
&& cmd->level <= get_trust( ch ) )
{
pager_printf( ch, " %-12s", cmd->name );
if ( ++col % 6 == 0 )
send_to_pager( "\n\r", ch );
}
if ( col % 6 != 0 )
send_to_pager( "\n\r", ch );
return;
}
I was looking at the regular slist command but there are different variables, could anyone help me with this?
| Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 12 Dec 2001 09:59 AM (UTC) |
Message
| It isn't clear what your question is exactly, but I would change the line:
pager_printf( ch, " %-12s", cmd->name );
to
pager_printf( ch, " %-12s(%i)", cmd->name, cmd->level );
That would display the level in brackets after each command, if that is what you are trying to do. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Turmoil
(5 posts) Bio
|
Date
| Reply #2 on Wed 12 Dec 2001 10:24 AM (UTC) |
Message
| Thanks a bunch. It was a quick reply and it was exactly what the question was. I know c++, kinda trying to get along on that but I just didn't know what was going on with the variables. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
11,799 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top