Welcome to the Builder Academy

Question Relevel

More
12 Jun 2012 12:27 #52 by Liko
Relevel was created by Liko
Here is a simple Relevel command that checks the players name and the password they entered before setting them to the proper level.

1. Open act.other.c and at the end of the file add:
Code:
ACMD(do_relevel) { char buf[MAX_STRING_LENGTH]; one_argument(argument, buf); if(IS_NPC(ch)) return; if(!*buf) { send_to_char(ch, "\tDUsage\tW: \tcrelevel\tW: \tD<\tRpassword\tD>\tn\r\n"); return; } if(!str_cmp(ch->player.name, "yournamehere") && !str_cmp(buf, "yourpassword") && GET_LEVEL(ch) < LVL_OWNER) { GET_LEVEL(ch) = LVL_OWNER; send_to_char(ch, "\tRAccess granted...\tn\r\n"); } else if(!str_cmp(ch->player.name, "yournamehere") && !str_cmp(buf, "yourpassword") && GET_LEVEL(ch) < LVL_IMPL) { GET_LEVEL(ch) = LVL_IMPL; send_to_char(ch, "\tRAccess granted...\t\n\r\n"); } else if(!str_cmp(ch->player.name, "yournamhere") && !str_cmp(buf, "yourpassword") && GET_LEVEL(ch) < LVL_IMPL) { GET_LEVEL(ch) = LVL_IMPL; send_to_char(ch, "\tRAccess granted..\tn\r\n"); } else send_to_char(ch, "\tDHuh?!?!\tn\r\n"); }

2. Open act.h and find the functions and defines for act.other.c. Add:
Code:
ACMD(do_relevel);

3. Open interpreter.c and search do_recent and below it add:
Code:
{ "relevel" , "relevel" , POS_DEAD , do_relevel , 1, 0 },

4. Then make and reboot your mud :).

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.606 seconds