/piss

Re: /piss

Postby Conor » 27 Jul 2013, 02:47

qpqpqp123 wrote:in that more nice work with switch and case exam of that on cmd like your:
Code: Select all
//Made by Breakdown901
using System;
namespace MCDzienny
{
   public class CmdPiss : Command
   {
      public override string name { get { return "piss"; } }
      public override string shortcut { get { return ""; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
      public override void Use(Player p, string message)
      {
            switch (message)
            {
                case "myself":
                    Player.GlobalMessage(p.PublicName + " just pissed on their self!");
               Command.all.Find("place").Use(p, "water");
                    break;
                case "frenzy":
                    Player.GlobalMessage(p.PublicName + " really had to go! &cRUN!!!");
               Command.all.Find("physics").Use(p, "3");
               Command.all.Find("place").Use(p, "waterfall");
                    break;
                default:
                  Player who = Player.Find(message);

                if (who == null)
                {
                    Player.SendMessage(p, "Player not found!");
                    return;
                }
                else
                {
               Player.GlobalMessage(p.color + p.PublicName + " just pissed on " + who.PublicName);
               Command.all.Find("place").Use(who, " water");
               }
                    break;
            }
      }
         

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/piss - /piss [player] - Piss on someone.");
         Player.SendMessage(p, "/piss myself - Piss on yourselve.");
         Player.SendMessage(p, "/piss frenzy - Use this if you really had to let it out!");
      }
   }
}


This is very good advice :) Breakdown, you should take time to learn the switch statement, it may help you in the future!
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /piss

Postby Breakdown901 » 27 Jul 2013, 09:38

Thanks guys! I'll certainly look into this Conor, and thanks qpqpqp!
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Previous

Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 4 guests

cron