RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[Hunger command

Mr. Friday

Wanderer
[Hunger command

This command checks your hunger level without having to eat food.

Code:
using System;
using System.Collections;
using Server;
using Server.Targeting;
using Server.Mobiles;

namespace Server.Scripts.Commands
{
	public class HungerCheck
	{
		public static void Initialize()
		{
			Server.Commands.Register( "Hunger", AccessLevel.Player, new CommandEventHandler( GetHunger_OnCommand ) );
		}
		
	public static void GetHunger_OnCommand( CommandEventArgs arg )
	{
		PlayerMobile m = arg.Mobile as PlayerMobile;
				if ( m.Hunger < 5 )
					m.SendMessage( "You are starving." );
				else if ( m.Hunger < 10 )
					m.SendMessage( "You are very hungry." );
				else if ( m.Hunger < 15 )
					m.SendMessage( "You feel quite content." );
				else
					m.SendMessage( "Your stomach feels bloated and full." );
	}
	}
}

Just type [hunger in game and a description of your hunger level is displayed.
 

FooFaH

Wanderer
Is this to be inserted somewhere? Or can I just make a hunger.cs and put it where? I'm a n00b... thanks

And YAY! thanks... wanted this one for a long time... I hate to be hungry and not know it :)
 

xXSXFGFXXx

Wanderer
Mr. Friday said:
just put it in your commands folder in scripts. It should work anywhere though, I believe.

Next time, use the "Manage Attachments" buttons and upload your script, other then that good job - im using this :p
 
Top