OUTLAW Function

From: Brian Christopher Guilbault (guil9964@nova.gmi.edu)
Date: 01/03/96


And Another Question for You All-

(What would I do without you guys? :-)

On our mud, we have an 'outlaw' command which makes you an outlaw 
(surprise!). But, we have had problems with people accidentally turning 
it on by typing 'out' instead of 'put' since 'o' and 'p' are right next to 
eachother, etc. So I am putting in something like in do_shutdown that 
sends a message unless you type the entire word. It looks just like 
shutdown, yet you can never get past the warning message. The warning 
comes up fine if you type 'o' or 'outl' or whatever, but even if you type 
'outlaw' it comes up and never sets the bit. I have included the code 
below. I know the function itself works fine. We never had any problems 
until we added the subcmd line and the confirmation line.

Any Help is Appreciated,

    -Brian


/* in interpreter.c command list */
{ "outlaw"     , POS_DEAD    , do_outlaw     , 1, 0 },

/* the actual function */
ACMD(do_outlaw) /* function created by xyzzy for outlaws */
{

    if (subcmd != SCMD_OUTLAW) {   /* Safety feature added by Dante */
    send_to_char("Becoming an OUTLAW is a serious matter. You must\r\n", ch);
    send_to_char("type the entire word 'outlaw'. You may also want\r\n", ch);
    send_to_char("to read 'help outlaw' before continuing with this.\r\n", ch);
    return;
    }

  if (PLR_FLAGGED(ch, PLR_OUTLAW))
  {
	send_to_char("You're already an outlaw. No turning back.\n\r",ch);
	return;
  }
  if(IS_AFFECTED(ch, AFF_CHARM))
  {
	send_to_char("You cannot become an OUTLAW while charmed.\n\r",ch);
  	return;
  }
  if (GET_LEVEL(ch) < 15)
  {
        send_to_char("You are to low of a level, you may die instantly.\n\r",ch);
        return;
  }

    send_to_char("Are you absolutely certain that you wish to become an OUTLAW?\r\n
	       You can kill or be killed as an OUTLAW!  That is your warning\r\n
               Type 'yes' to become OUTLAW, or 'no' to keep from being OUTLAW: ", ch); 

    if (!strcmp(arg, "yes") || !strcmp(arg, "YES")) {	
    SET_BIT(PLR_FLAGS(ch),PLR_OUTLAW);
	send_to_char("You are now an outlaw, there is no turning back!\n\r",ch);
	return;
  }
}   



This archive was generated by hypermail 2b30 : 12/07/00 PST