com/CMD_ACCESS.c - example for course 13

[previous example] [course 13] [Table of contents] [next example]
/* Filename      : CMD_ACCESS.c
 * Description   : who can use the guilds commands
 *
 * written       : 30-05-1998 - Gunner
 * last modified : 31-05-1998 - Gunner
 * HTML-Version  : 13-02-2000 - Ghorwin
 */

#include "/doc/crashcourse/course13/include/guild.h"
inherit I_DAEMON;

int
query_access(object player)
{
    if (player->query_dead())
        NOT_FAIL("You are dead and can't do much more than drift around.\n");

    // We allow monsters and wizards to use our commands.
    if (!interactive(player) || is_wiz(player))
        return 1;

    // Other guilds may NOT use our commands.
    if (Q_GUILD(player) != GUILD_MASTER)
        return 0;

    return 1;
}