I keep getting these errors and I dont know how to fix them.
Spoiler:
-------------------------
Error #CS0234
Message: The type or namespace name 'RoundStart' does not exist in the namespace 'MCDzienny.InfectionSystem' (are you missing an assembly reference?)
Line: 27
-------------------------
Error #CS0123
Message: No overload for 'InfectionRoundEnded' matches delegate 'System.EventHandler<MCDzienny.InfectionSystem.AnnounceWinnersEventArgs>'
Line: 28
Error #CS0234
Message: The type or namespace name 'RoundStart' does not exist in the namespace 'MCDzienny.InfectionSystem' (are you missing an assembly reference?)
Line: 27
-------------------------
Error #CS0123
Message: No overload for 'InfectionRoundEnded' matches delegate 'System.EventHandler<MCDzienny.InfectionSystem.AnnounceWinnersEventArgs>'
Line: 28
Here is the current code-
Spoiler:
- Code: Select all
using System;
using MCDzienny.InfectionSystem;
using System.Threading;
namespace MCDzienny
{
public class CmdZman : Command
{
private volatile bool zman = false;
public override string name { get { return "zman"; } }
public override string shortcut { get { return "zm"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdZman() { }
public override void Use(Player p, string message)
{
if (zman) { Player.SendMessage(p, "You already took the zman challenge"); return; }
zman = true;
Player.GlobalMessage(p.color + p.name + Server.DefaultColor + " has taken the zman challenge!");
Player.SendMessage(p, "Watch those zombies closely!");
}
public override void Init()
{
InfectionSystem.RoundStart += RoundStart;
InfectionSystem.InfectionSystem.AnnounceWinners += InfectionRoundEnded;
}
private void RoundStart(Player p, RoundStartEventArgs e)
{
int count;
count = p.overallDeath + 1;
while (zman == true)
{
p.level.Blockchange(p, (ushort)(p.pos[0] / 32), (ushort)(p.pos[1] / 32 + 3), (ushort)(p.pos[2] / 32), Block.zombiebody);
Thread.Sleep(10000);
if (p.overallDeath == count || p.isZombie == true)
{
p.money = p.money - 20;
Player.SendMessage(p, "You have failed the zman challenge!");
if (p.overallDeath == count)
{
InfectionSystem.InfectionSystem.notInfected.Remove(p);
InfectionSystem.InfectionSystem.infected.Add(p);
Player.SendMessage(p, "You are now a zombie!");
}
zman = false;
}
}
}
private void InfectionRoundEnded(Player p, InfectionSystem.AnnounceWinnersEventArgs e)
{
if (zman)
{
p.money = p.money + 20;
zman = false;
Player.SendMessage(p, "You gained an extra 20 " + Server.moneys);
}
else { Player.SendMessage(p, "Sorry, you didnt make the cut this time."); }
}
public override void Help(Player p)
{
Player.SendMessage(p, "/zman, take the zman challenge if you dare.");
}
}
}