Thread: Chown Command
View Single Post
Old 01-27-2003, 11:37 AM   #5
Terloch
Member
 
Join Date: Apr 2002
Location: Chicago, Illinois
Posts: 152
Terloch is on a distinguished road
Here's the syntax for our command which does probably the same thing as what you are trying to get to work...hope it helps...

DO_CMD ( do_seize )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA * victim;
OBJ_DATA *obj;
OBJ_DATA *obj_next;
bool found;

argument = one_argument ( argument, arg );
if ( arg[0] == '\0' )
{
send_to_char ( "{WSyntax:\n\r seize char <char> <object>{x\n\r", ch );
send_to_char ( " seize container <container> <object>{x\n\r", ch );
return;
}

if ( !str_prefix ( arg, "char" ) )
{
argument = one_argument ( argument, arg );
if ( arg[0] == '\0' )
{
do_function ( ch, &do_seize, "" );
return;
}

if ( ( victim = get_exact_player_room ( ch, arg ) ) == NULL )
{
send_to_char ( "They are not here.\n\r", ch );
return;
}

if ( IS_TRUSTED ( victim, LEVEL_ANCIENT ) )
{
send_to_char ( "Not on ancients.\n\r", ch );
return;
}

argument = one_argument ( argument, arg );
if ( arg[0] == '\0' )
{
do_function ( ch, &do_seize, "" );
return;
}

found = FALSE;
for ( obj = victim->carrying; obj != NULL; obj = obj_next )
{
obj_next = obj->next_content;

if ( is_name ( arg, obj->name ) )
{
found = TRUE;
obj_from_char ( obj );
obj_to_char ( obj, ch );
send_to_char ( "Ok.\n\r", ch );
ACT_OC ( "{WYou couldn't tell how it happened, but $p is now in $r's possesion.{x",
ch, obj, victim, TO_VICT );
}
}

if ( !found )
{
send_to_char ( "No such item found.", ch );
}
}

else if ( !str_prefix ( arg, "container" ) )
{
send_to_char ( "Not implemented.\n\r", ch );
}

else
{
do_function ( ch, &do_seize, "" );
}

return;
}

Terloch
Terloch is offline   Reply With Quote