Compiler Error, dont understand.

Re: Compiler Error, dont understand.

Postby Breakdown901 » 14 Jul 2013, 18:29

Anyone?
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: Compiler Error, dont understand.

Postby tinyCreeper » 14 Jul 2013, 21:27

Your brackets were all messed up. I rearranged it and changed it for you. You can edit this to fit what you need.

Code: Select all
//Made by Breakdown901
using System;
namespace MCDzienny
{
   public class CmdReport : Command
   {
      public override string name { get { return "report"; } }
      public override string shortcut { get { return "rt"; } }
      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.Split(' ')[0]);
          string reason = (message.Split(' ')[1]);
          if (who == null)
          {
              Player.SendMessage(p, "Player is not online.");
              return;
          }
          else
          {
              if (reason == "")
              {
                  Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " reported " + who.color + who.PublicName + Server.DefaultColor + " for breaking the rules!", false);
              }
              else if (reason == "griefing")
              {
                  Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " reported " + who.color + who.PublicName + Server.DefaultColor + " for &griefing!", false);
              }
              else if (reason == "spleefing")
              {
                  Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " reported " + who.color + who.PublicName + Server.DefaultColor + " for &cspleefing!", false);
              }
              else if (reason == "spamming blocks")
              {
                  Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " reported " + who.color + who.PublicName + Server.DefaultColor + " for &cspamming blocks!", false);
              }
              else if (reason == "swearing")
              {
                  Player.GlobalMessage(p, p.color + p.name + Server.DefaultColor + " reported " + who.color + who.PublicName + Server.DefaultColor + " for &cswearing or using offensive language!", false);
              }
              else
              {
                  Player.SendMessage(p, "Please report this player for a valid reason!");
                  Player.SendMessage(p, "Valid reasons include: 'griefing', 'spleefing', 'spamming blocks', or 'swearing'.");
              }
          }
      }
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/report - /report [player] [reason]");
         Player.SendMessage(p, "*Valid reasons are: 'griefing', 'spleefing', 'spamming blocks', 'swearing', or just /report [player]");
      }
    }
}
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

Re: Compiler Error, dont understand.

Postby Clowny » 14 Jul 2013, 21:49

Yeah you just need to be careful how you place your brackets I had this same problem when I started
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

Re: Compiler Error, dont understand.

Postby Conor » 14 Jul 2013, 23:56

You've probably heard it 50 times already but you should use a reliable IDE like Microsoft Visual Studio (2010 or 2012), you won't ever need to worry about these problems as you will see the errors as you're programming and can quickly modify your code before things get worse.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: Compiler Error, dont understand.

Postby tinyCreeper » 15 Jul 2013, 00:03

100% agree with Conor. I used to try to code from notepad and stuff, but Visual Studio is 1000 times better.
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

Re: Compiler Error, dont understand.

Postby Breakdown901 » 15 Jul 2013, 00:07

The thing is though, is that I can't install things. My Dad is the administrator of my computer, and I'd need his password to install it because you can't install without admin rights. So basicially the only way I could get it is through a .zip file or something. I would if I could, but I can't :(
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: Compiler Error, dont understand.

Postby Breakdown901 » 15 Jul 2013, 00:13

Forgot to say, he won't give me hsi password or install it for me/let me install it on his account.
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: Compiler Error, dont understand.

Postby Breakdown901 » 15 Jul 2013, 00:54

Would it be possible to install VS 2010 C# onto my laptop, then transfer it onto my computer and that would bypass the admin rights? Or would i still be prompted with the admin password bit when I try to start it up?
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: Compiler Error, dont understand.

Postby Conor » 15 Jul 2013, 00:57

Breakdown901 wrote:Would it be possible to install VS 2010 C# onto my laptop, then transfer it onto my computer and that would bypass the admin rights? Or would i still be prompted with the admin password bit when I try to start it up?


I don't think its as simple as copy and pasting it across, it is a large software which must be installed correctly, you also 'license' it to your own computer/name so I think it wouldn't work if you did get it on to your laptop anyway.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: Compiler Error, dont understand.

Postby tinyCreeper » 15 Jul 2013, 01:04

I don't see a reason why you couldn't download it on your laptop, do your coding on your laptop, then send your cmds to your other pc to apply them to your server or whatever.

It's more work, but it's worth it.
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

PreviousNext

Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest