Wizcommands/commands and how to get them to display levels?

Posted by Turmoil on Wed 12 Dec 2001 09:03 AM — 3 posts, 14,569 views.

#0
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?
Australia Forum Administrator #1
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.
#2
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.