[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /cmds/player/group_cmds/base_group.c</h2>
This is the base file for a group sub command.  All group sub commands
inherit this file.
<p>
To create a new sub command that plugs in to the master "group"
command, create a new file in the directory where sub commands
are stored and have it inherit this file.
<p>
One file can support several verbs, however it is strongly discouraged
unless they are *very* closely tied together.  The file also supports
different patterns for the same verb, which is no problem, and in no
way discouraged.
<p>
It is suggested you name the file the same name as the verb(s) it
declares.
<p>Written by Tape
<h2>Method index</h2>
<dl><ul>
<li><a href="#add_group_sub_command">add_group_sub_command</a>(string, string, function)<br/>
This function declares a new sub command.
<li><a href="#query_group_sub_command_amount">query_group_sub_command_amount</a>()<br/>
This is the signature function for a group sub command.
<li><a href="#query_group_sub_command_function">query_group_sub_command_function</a>(string, string)<br/>
This function returns the command function for a specific verb and
pattern.
<li><a href="#query_group_sub_command_patterns">query_group_sub_command_patterns</a>(string)<br/>
This function returns all patterns for a specific verb.
<li><a href="#query_group_sub_command_verbs">query_group_sub_command_verbs</a>()<br/>
This function returns all the verbs that have been declared by
this object.
<li><a href="#query_leadership_required">query_leadership_required</a>(string, string)<br/>
This function returns whether a command user has to be the leader
of a group in order to use that command.
<li><a href="#query_membership_required">query_membership_required</a>(string, string)<br/>
This function returns whether a command user has to be a member
of a group in order to use that command.
<li><a href="#remove_group_sub_command">remove_group_sub_command</a>(string, string)<br/>
This function will remove a command from the list of declared sub
commands.
<li><a href="#set_leadership_required">set_leadership_required</a>(string, string, int)<br/>
This function sets a flag which requires the player accessing
the command to be the leader of a group.
<li><a href="#set_membership_required">set_membership_required</a>(string, string, int)<br/>
This function sets a flag which requires the player accessing
the command to be a member of a group.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_group_sub_command">
add_group_sub_command</a><pre>
int add_group_sub_command(string verb,
                          string pattern,
                          function cmd_function)
</pre></br>
This function declares a new sub command.  If the verb provided already
exists, it assumes it is a version of the command that uses a different
pattern.  If the verb *and* the pattern already exist, the function
will fail.  The cmd_function variable should point to the function
which contains the command code.  This function will return 1 or 0
depending if the command succeeds and is passed the same arguments
as normal commands get.  An additional argument ($6) can be
included which returns the group this_player() is a member of
(if any).

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the verb for the command
<br/>pattern - the command pattern
<br/>cmd_function - the command function

<li><b>Returns:</b>
<br/>1 on success, 0 on failure
<li><b>See also:</b>
<br/><a href="#add_command">add_command()
</a><li><b>Example:</b>
<br/><pre>add_group_sub_command( "join", "<indirect:object'member of a
group'>", (: do_join( $1, $6 ) :)
</pre></dl>

<ul><a name="query_group_sub_command_amount">
query_group_sub_command_amount</a><pre>
int query_group_sub_command_amount()
</pre></br>
This is the signature function for a group sub command.
<br/><ul>
<li><b>Returns:</b>
<br/>number of sub-commands

</dl>

<ul><a name="query_group_sub_command_function">
query_group_sub_command_function</a><pre>
varargs function * query_group_sub_command_function(string verb,
                                                    string pattern)
</pre></br>
This function returns the command function for a specific verb and
pattern.  If only the verb is provided, all functions for that
verb are returned (in no particular order).
<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the command verb
<br/>pattern - the command pattern (optional)
<li><b>Returns:</b>
<br/>array of pointer(s) to the function, 0 if verb/pattern doesn't exist

</dl>

<ul><a name="query_group_sub_command_patterns">
query_group_sub_command_patterns</a><pre>
string * query_group_sub_command_patterns(string verb)
</pre></br>
This function returns all patterns for a specific verb.
<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the verb you want patterns for
<li><b>Returns:</b>
<br/>a string array of the patterns, 0 if verb doesn't exist

</dl>

<ul><a name="query_group_sub_command_verbs">
query_group_sub_command_verbs</a><pre>
string * query_group_sub_command_verbs()
</pre></br>
This function returns all the verbs that have been declared by
this object.
<br/><ul>
<li><b>Returns:</b>
<br/>a string array of the verbs

</dl>

<ul><a name="query_leadership_required">
query_leadership_required</a><pre>
varargs int query_leadership_required(string verb,
                                      string pattern)
</pre></br>
This function returns whether a command user has to be the leader
of a group in order to use that command.  If no pattern is
provided, a flag for a random pattern for that verb is returned.  This
is not suggested unless it is certain that all patterns use
the same settings, and/or there is only one pattern for that
verb.

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the command verb
<br/>pattern - the pattern for the verb (optional)
<li><b>Returns:</b>
<br/>1 if membership is required, 0 if not, -1 if verb/pattern not found

</dl>

<ul><a name="query_membership_required">
query_membership_required</a><pre>
varargs int query_membership_required(string verb,
                                      string pattern)
</pre></br>
This function returns whether a command user has to be a member
of a group in order to use that command.  If no pattern is
provided, a flag for a random pattern for that verb is returned.  This
is not suggested unless it is certain that all patterns use
the same settings, and/or there is only one pattern for that
verb.

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the command verb
<br/>pattern - the pattern for the verb (optional)
<li><b>Returns:</b>
<br/>1 if membership is required, 0 if not, -1 if verb/pattern not found

</dl>

<ul><a name="remove_group_sub_command">
remove_group_sub_command</a><pre>
varargs int remove_group_sub_command(string verb,
                                     string pattern)
</pre></br>
This function will remove a command from the list of declared sub
commands.  If a pattern is provided, it will try to only remove
that specific pattern.

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the verb to be removed
<br/>pattern - the specific pattern to be removed (optional)
<li><b>Returns:</b>
<br/>1 on success, 0 on failure

</dl>

<ul><a name="set_leadership_required">
set_leadership_required</a><pre>
int set_leadership_required(string verb,
                            string pattern,
                            int flag)
</pre></br>
This function sets a flag which requires the player accessing
the command to be the leader of a group.  This is automatically
handled by the master command before the actual command function
is called.  If no pattern is specified, then the flag is set
for all patterns of that verb.

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the command verb
<br/>pattern - the command pattern, or 0
<li><b>Returns:</b>
<br/>1 on success, 0 if verb/pattern not found

</dl>

<ul><a name="set_membership_required">
set_membership_required</a><pre>
int set_membership_required(string verb,
                            string pattern,
                            int flag)
</pre></br>
This function sets a flag which requires the player accessing
the command to be a member of a group.  This is automatically
handled by the master command before the actual command function
is called.  If no pattern is specified, then the flag is set
for all patterns of that verb.

<br/><ul>
<li><b>Parameters:</b>
<br/>verb - the command verb
<br/>pattern - the command pattern, or 0
<li><b>Returns:</b>
<br/>1 on success, 0 if verb/pattern not found

</dl>


[an error occurred while processing this directive]

