inherit "/room/room";
#include <ansi.h>

reset(arg)
{
::reset(arg);

if(arg) return;
	set_light(1);
	short_desc = "A Room";
	long_desc =
		"Holy shit, it's a room!\n";
items =

({
	"room",
	"Holy shit! A room? Where? ... Dumbass",
});

dest_dir =
({
	"/players/gideon/workroom.c",	"workroom",
});
}


init()
{
	::init();
	
	add_action("swing", "swing");
}

swing(str)
{
	if(!str)
	{
		write("What would you like to swing on?\n");
		return 1;
	}
	
	if(str != "on rope")
	{
		write("You cannot swing on that!\n");
		return 1;
	}
	
	if(str == "on rope")
	{
		call_other(this_player(), "move_player","swings away#players/gideon/workroom.c");
		say(this_player()->query_name()+" swings away on the rope.\n");
		return 1;
	}
}


You need init() and the ::init(); for the function to work
and put it AFTER the basic shit as you see above...

add_action("swing", "swing");
The first "swing" in this line is what the function is called
The second one is the command for the person to use

} closes off the init(){

swing(str) will let the add_action("swing", "swing"); know to check here for the swing command.
If there isn't suppose to be a string (str), like if you wanted to make them 'search' a room, you would use search()
If you wanted them to search a tree or something then you'd use search(str)
{ bracket starts the function command

if(!str)
{
	write("What would you like to swing on?\n");
	return 1;
}

If the player types swing alone, it'll say to the player "What would you like to swing on? the \n is to make the line end there.
return 1; is to drop to the next line

Without the \n and return 1;, it would look like this after typing 'search' then 'monitor':

What would you like to swing on?<<<<  HP 3002/3002 SP 2276/2396 I 0% F 0% S 0% T 0%  >>>>

close off the bracket }

if(str != "on rope")
{
	write("That is not here to swing on!\n");
	return 1;
}

If the player types in something like 'swing treevine', it'll say "That is not here to swing on!

And finally,

if(str == "on rope")
{
		call_other(this_player(), "move_player","swings away to#players/gideon/workroom.c");
		say(this_player()->query_name()+" swings away on the rope.\n");
		return 1;
	}
}

If the player types swing on rope, it'll call_other (call a command i assume) for the player (this_player())
that typed it to "swings away to"# then put the path of the room it's suppose to go to
say will put a message in the room... So if Worm and Maximus are in the same room and Worm "swing on rope", it'll say
"Worm swings away on the rope." to Maximus. 

Don't forget to close off the bracket to the if(str == "on rope")
Then close off the swing(str){ command with a }


If you have any questions, let me know.
