/********************************************************************* v.1 change_command_privs.cz function to change the privs necessary to use a command, while the talker is online Requirments: ewtoo derivitive talker Installing: add the function to admin.c at the top of admin.c put extern struct command *coms[]; Notes: This will change all commands that access preform the same function of the command you give... for example, if you do change_command_privs help base it will change 'help', 'man', and '?' to require the base priv Any privs grantable (in permission_list[]) are valid. These dont save of course... it doesnt alter your code. Bug Reports: send to phypor@benland.muc.edu Licences: freely distributable and modifiable, if you redistribute ... the src code must be credited to phypor you dont have to add anything to help credits if you do not wish Warranty: non, the author is in no way responsible for use, misuse, abuse, or any other actions misactions, reactions of this code, its provided as is. Author: phypor "if it breaks you get to keep both pieces" ~old linux proverb *********************************************************************/ void change_command_privs ( player * p, char * str ) { struct command *comlist = coms[0]; struct command *scan; char *privs; int newprivs, i; privs = next_space (str); *privs++ = '\0'; if (!*privs) { tell_player (p, " Format : change_command_privs \n"); return; } newprivs = get_flag (permission_list, privs); if (!newprivs && strcasecmp (privs, "newbie")) { ez_tell_player (p, " Herms, '%s' isnt a valid permission ...\n", privs); return; } if (isalpha (*str)) comlist = coms[((int) (tolower (*str)) - (int) 'a' + 1)]; while (comlist && comlist->text && comlist->text[0]) { if (!strcasecmp (str, comlist->text)) { for (i = 0; i <= ((int) 'z' - (int) 'a' + 1); i++) for (scan = coms[i]; scan && scan->text; scan++) if (scan->function == comlist->function) { scan->level = newprivs; ez_tell_player (p, " Shagged '%s' into a/n %s command, " "yeah baby!\n", scan->text, privs); } ez_log ("commands", "%s changes %s to %s level", p->name, str, privs); return; } comlist++; } ez_tell_player (p, " That priv you gave is valid, but the command '%s' cant " "be found.\n", str); }