for loop

for loop

Postby Breakdown901 » 14 Jul 2013, 22:55

To get this command to work, because currently it shows up nothing but it does compile and load, would I need to put in using System.IO or using System.Timers.Timer?

Code: Select all
using System;
namespace MCDzienny
{
   public class CmdTimeru : Command
   {
      public override string name { get { return "timeru"; } }
      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)
      {
         for (int i = 1; i >= 5; i++)
         {
         Console.WriteLine(i);
         }
         {
         for (initializer; condition; iterator)
         body
         }
      }         
         
      }
      public override void Help(Player p)
      {
         Player.SendMessage(p, "/timeru - Counts from 1 to 20");
      }
   }
}
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: for loop

Postby Clowny » 14 Jul 2013, 23:21

Why not try both? I'm not sure
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: for loop

Postby Breakdown901 » 14 Jul 2013, 23:46

I'm not on my computer just now so I don't know :P
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: for loop

Postby Conor » 14 Jul 2013, 23:48

See my response here.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: for loop

Postby Leeizazombie » 15 Jul 2013, 12:09

This code doesnt work in minecraft:
Code: Select all
Console.WriteLine(i);

Try changing it to
Code: Select all
Player.SendMessage(i);
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: for loop

Postby joppiesaus » 15 Jul 2013, 12:55

The namespace System.IO is never used for this kind of stuff.
System.IO is for the file system, it allows you to edit, create, delete... etc. files and directories.

That isn't the solution to this problem, I know the solution, but you can follow Conor's adivce better(same point)
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest