Problems with arg manipulation

From: Alex Mann (alex4501@hotmail.com)
Date: 06/15/02


Hi

  I am writing a command that allows a player to use a certain number of
practices to improve a stat of thier choice by one  point.

The bit that isn't working and im not sure hw best to do is the following
file and the code that then follows.

if (arg == "str") ******This picks out the train str ********
  {
             if (GET_PRACTICES(ch) < 3)   /* Check if they have enough
practices to train */
                {
                   send_to_char(ch, "You dont have enough practices to train
in that skill.\r\n You require 3 practice sessions to train. \r\n");
                   return;
                }

             if (GET_STR(ch) >= maxstr)    /* Check the stat isn't already
maxed out */
                {
                   send_to_char(ch, "You are not able to further train your
strength. \r\n");
                   return;
                }

            else   /* Remove 3 practices and add 1 to the stat */
               {
                  GET_PRACTICES(ch)=(GET_PRACTICES(ch) - 3);
                  GET_STR(ch)= (GET_STR(ch) + 1);
                  send_to_char(ch, "You train for some time and your
strength increases slightly. \r\n" );
                  return;
               }
   }

else if (arg == "dex")******This picks out the train dex ********
  {
             if (GET_PRACTICES(ch) < 3)   /* Check if they have enough
practices to train */
                {
                   send_to_char(ch, "You dont have enough practices to train
in that skill.\r\n You require 3 practice sessions to train. \r\n");
                   return;
                }

             if (GET_STR(ch) >= maxdex)    /* Check the stat isn't already
maxed out */
                {
                   send_to_char(ch, "You are not able to further train your
dexterity. \r\n");
                   return;
                }

            else   /* Remove 3 practices and add 1 to the stat */
               {
                  GET_PRACTICES(ch)=(GET_PRACTICES(ch) - 3);
                  GET_DEX(ch)= (GET_DEX(ch) + 1);
                  send_to_char(ch, "You train for some time and your
dexterity increases slightly. \r\n" );
                  return;
               }
   }

else
{
   send_to_char(ch, "What do you want to train.\r\n");
   return;
}


At the moment it simply skips to the final else and fails to pick up the
stat to train. Can anyone advised the best way to use if (arg =="str") or
how this line should be written to perform this function.

Thanks

Alex Mann

Naryan World


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT