//Created By Clowny
using System;
namespace MCDzienny
{
public class CmdHug : Command
{
public override string name { get { return "hug"; } }
public override string shortcut { get { return "hg"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public override bool ConsoleAccess { get { return false; } }
public override void Use(Player p, string message)
{
if (message == null) // its better to use == null instead of == ""
{
Help(p); // better to lay it all out then to push together as before.
return;
}
Player who = Player.Find(message.Split(' ')[0]);
if (who == null)
{
Player.SendMessage(p, "Player is not online.");
return; // if you have a return;, you don't need a else statement. else statement will only occur if the if statement wasn't completed, while return; will just stop the if statement if it wasn't completed.
}
string reason = message.Split(' ')[1]; // if you try to use the string message, it'll think ur going to type /hug tight, which you arent. you are going to type /hug [player] tight.
if (reason == "tight")
{
Player.GlobalMessage(p.color + p.PublicName + " &shugged " + who.color + who.PublicName + " &stightly, maybe a little too tight..."); // also, you do not need the p, at the beginning of a GlobalMessage (not GlobalChat), or the , false at the end.
return; // also, shortcuts to Server.DefaultColor is just putting & or %s as a color code, also if you are going to use p.name or who.name in a message, use p.PublicName or who.PublicName so it doesn't show the email.
}
Player.GlobalMessage(p.color + p.PublicName + " &sgave " + who.color + who.PublicName + " &sa warm hug.");
}
public override void Help(Player p)
{
Player.SendMessage(p, "/hug [player] (tight) - Gives someone a nice, warm hug."); // fixed some grammatically errors.
}
}
}
//Created By Clowny
using System;
namespace MCDzienny
{
public class CmdHug : Command
{
public override string name { get { return "hug"; } }
public override string shortcut { get { return "hg"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public override bool ConsoleAccess { get { return false; } }
public override void Use(Player p, string message)
{
if (message == null) // its better to use == null instead of == ""
{
Help(p); // better to lay it all out then to push together as before.
return;
}
Player who = Player.Find(message.Split(' ')[0]);
if (who == null || who.hidden) // ~ make sure to put who.hidden or else people can use it on people that are hidden and be proven they are online. ~
{
Player.SendMessage(p, "Player is not online.");
return; // if you have a return;, you don't need a else statement. else statement will only occur if the if statement wasn't completed, while return; will just stop the if statement if it wasn't completed.
}
string reason = message.Split(' ')[1]; // if you try to use the string message, it'll think ur going to type /hug tight, which you arent. you are going to type /hug [player] tight.
if (reason == "tight")
{
Player.GlobalMessage(p.color + p.PublicName + " &shugged " + who.color + who.PublicName + " &stightly, maybe a little too tight..."); // also, you do not need the p, at the beginning of a GlobalMessage (not GlobalChat), or the , false at the end.
// also, shortcuts to Server.DefaultColor is just putting & or %s as a color code, also if you are going to use p.name or who.name in a message, use p.PublicName or who.PublicName so it doesn't show the email.
}
else // ~ that is where a else statement comes in handy :p ~
{
Player.GlobalMessage(p.color + p.PublicName + " &sgave " + who.color + who.PublicName + " &sa warm hug.");
}
}
public override void Help(Player p)
{
Player.SendMessage(p, "/hug [player] (tight) - Gives someone a nice, warm hug."); // fixed some grammatically errors.
}
}
}
//Created By Clowny
using System;
namespace MCDzienny
{
public class CmdHug : Command
{
public override string name { get { return "hug"; } }
public override string shortcut { get { return "hg"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
string[] mess = message.Split(' ');
Player who = Player.Find(mess[0]);
if (who == null)
{
Player.SendMessage(p, "Player is not online.");
return;
}
else if (mess.Length == 2)
{
if (mess[1] == "tight")
{
Player.GlobalMessage(p.color + p.name + Server.DefaultColor + " hugged " + who.color + who.name + Server.DefaultColor + " tightly, maybe a little too tightly...");
}
}
else if (mess.Length == 1)
{
Player.GlobalMessage(p.color + p.name + Server.DefaultColor + " gave " + who.color + who.name + Server.DefaultColor + " a warm hug.");
}
}
public override void Help(Player p)
{
Player.SendMessage(p, "/hug [player] - Gives someone a nice warm hug");
Player.SendMessage(p, "/hug [player] tight - Gives someone a tight hug");
}
}
}
Users browsing this forum: No registered users and 3 guests