Me again! This one should be faily simple, but I just dont see it yet. Ok I am adding the Gangiens snippet for wizhelp, making it sort the immortal commands by types. I am getting a parse error for some of the code I didnt change, and weird enough, all my braces have a partner. In my perfect world atleast.
act_wiz.c: In function `do_cedit':
act_wiz.c:7963: parse error before "ch"
act_wiz.c:7990: structure has no member named `type'
act_wiz.c:8020: structure has no member named `type'
act_wiz.c:8021: structure has no member named `type'
act_wiz.c:8022: structure has no member named `type'
act_wiz.c:8023: structure has no member named `type'
act_wiz.c:8024: structure has no member named `type'
act_wiz.c:8027: parse error before '}' token
act_wiz.c:8161: structure has no member named `type'
Im hoping the type error will go away once I fix thi parse error. Ok the code from the start of the funcion (at 7938) to 8027 is...
void do_cedit( CHAR_DATA *ch, char *argument )
{
CMDTYPE *command;
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
set_char_color( AT_IMMORT, ch );
smash_tilde( argument );
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' )
{
send_to_char( "Syntax: cedit save cmdtable\n\r", ch );
if ( get_trust(ch) > LEVEL_SUB_IMPLEM )
{
send_to_char( "Syntax: cedit <command> create \n\r", ch );
send_to_char( "Syntax: cedit <command> delete\n\r", ch );
send_to_char( "Syntax: cedit <command> show\n\r", ch );
send_to_char( "Syntax: cedit <command> raise\n\r", ch );
send_to_char( "Syntax: cedit <command> lower\n\r", ch );
send_to_char( "Syntax: cedit <command> list\n\r", ch );
send_to_char( "Syntax: cedit <command> [field]\n\r", ch );
send_to_char( "Syntax: cedit <command> type [type]\n\r",ch);
send_to_char( "\n\rType being one of:\n\r",ch);
send_to_char( "0=mortal, 1=misc, 2=admin, 3=punish, 4=general 5=build\n\r"ch);
send_to_char( "\n\rField being one of:\n\r", ch );
send_to_char( " level position log code flags\n\r", ch );
}
return;
}
if (get_trust(ch) > LEVEL_GREATER
&& !str_cmp( arg1, "save" ) && !str_cmp( arg2, "cmdtable") )
{
save_commands();
send_to_char( "Saved.\n\r", ch );
return;
}
command = find_command( arg1 );
if ( get_trust(ch) > LEVEL_SUB_IMPLEM && !str_cmp( arg2, "create" ) )
{
if ( command )
{
send_to_char( "That command already exists!\n\r", ch );
return;
}
CREATE( command, CMDTYPE, 1 );
command->lag_count = 0; /* FB */
command->name = str_dup( arg1 );
command->level = get_trust(ch);
command->type = 0;
if ( *argument )
one_argument(argument, arg2);
else
sprintf( arg2, "do_%s", arg1 );
command->do_fun = skill_function( arg2 );
add_command( command );
send_to_char( "Command added.\n\r", ch );
if ( command->do_fun == skill_notfound )
ch_printf( ch, "Code %s not found. Set to no code.\n\r", arg2 );
return;
}
if ( !command )
{
send_to_char( "Command not found.\n\r", ch );
return;
}
else
if ( command->level > get_trust(ch) )
{
send_to_char( "You cannot touch this command.\n\r", ch );
return;
}
if ( arg2[0] == '\0' || !str_cmp( arg2, "show" ) )
{
ch_printf( ch, "Command: %s\n\rLevel: %d\n\rPosition: %d\n\rLog: %d\n\rCode: %s\n\rType: %s\n\rFlags: %s\n\r",
command->name, command->level, command->position, command->log,
skill_name(command->do_fun),
command->type == 0 ? "Mortal" :
command->type == 1 ? "Misc" :
command->type == 2 ? "Admin" :
command->type == 3 ? "Punish" :
command->type == 4 ? "General" : "Build",
flag_string(command->flags, cmd_flags));
if ( command->userec.num_uses )
}
If someone can find the lonely brace in their, I sure would love to hear from you.
|