Sorry, need more help :P

Sorry, need more help :P

Postby Breakdown901 » 18 Jul 2013, 17:58

Gives me the /help message.

Code: Select all
//Made by Breakdown901
using System;
namespace MCDzienny
{
   public class CmdSuicidebomb : Command
   {
      public override string name { get { return "suicidebomb"; } }
      public override string shortcut { get { return "sb"; } }
      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)
      {
         if (message == "") { Help(p); return; }

                Player who = Player.Find(message);

                if (who == null)
                {
                Player.SendMessage(p, "Player not found!");
                return;
                }

                else
            {
               Command.all.Find("kill").Use(null, p.name + " explode");
            }
         }   

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/suicidebomb - Blows yourself up.");
      }
   }
}
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: Sorry, need more help :P

Postby ismellike » 18 Jul 2013, 18:24

Sorry, you probably saw that from hetal's topic.

the null in the Command.all.Find("kill") is supposed to be p
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Sorry, need more help :P

Postby Clowny » 18 Jul 2013, 22:11

so instead of
Code: Select all
Command.all.Find("kill").Use(null, p.name + " explode");

do
Code: Select all
Command.all.Find("kill").Use(p, p.name + " explode");
Founder Of MC Classic Hosting Community http://mcclassichosting.webs.com
Founder of MC Classic Software MCReborn http://mcreborn.tk
Professional Hoster and Basic C# Coder
Image
User avatar
Clowny
 
Posts: 112
Joined: 14 Jul 2013, 03:53


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron