Jump to content
  • 0
Sign in to follow this  
killers10333

PI zombie minigame help

Question

Alright so i followed a copy/paste guide to this minigame since i just wanted it in my server but it didnt have the rounds executed or rounds after the first one blah blah i fixed all that but now im having a problem. when i reach round 8 the server .bat reads an error and than every few seconds (the wait time between waves) it spawns that wave again so i just get piled with zombies. this is the error im recieving -


error-
[CODE][2/19/12 10:24 AM]: at server.model.minigames.ZombieMiniGame.spawnNextRound(
ZombieMiniGame.java:26)
[2/19/12 10:24 AM]: at server.model.npcs.NPCHandler$2.execute(NPCHandler.jav
a:1423)
[2/19/12 10:24 AM]: at server.event.EventContainer.execute(EventContainer.ja
va:51)
[2/19/12 10:24 AM]: at server.event.EventManager.run(EventManager.java:101)
[2/19/12 10:24 AM]: at java.lang.Thread.run(Unknown Source)
[2/19/12 10:24 AM]: Admin - actionbutton: 29138
[2/19/12 10:24 AM]: java.lang.ArrayIndexOutOfBoundsException: 8[/CODE]

and these are the lines that are apparently in question, but im not understanding how

NPChandler-
[CODE]private void killedZombie(int i) {
final Client c2 = (Client)Server.playerHandler.players[npcs[i].spawnedBy];
c2.ZombiesKilled++;
//System.out.println("To kill: " + c2.ZombiesToKill + " killed: " + c2.ZombiesKilled);
if (c2.ZombiesKilled == c2.ZombiesToKill) {
//c2.sendMessage("STARTING EVENT");
c2.RoundId++;
EventManager.getSingleton().addEvent(new Event() {
public void execute(EventContainer c) {
if (c2 != null) {
[COLOR="Red"]Server.zombieMiniGame.spawnNextRound(c2);[/COLOR]
}
c.stop();
}
}, 7500);

}
}[/CODE]

EventCOntainer -
[CODE]public void execute() {
this.lastRun = System.currentTimeMillis();
[COLOR="Red"]this.event.execute(this);[/COLOR]
}[/CODE]

EventManager -

[CODE]for (EventContainer container : events) {
if (container.isRunning()) {
if ((System.currentTimeMillis() - container.getLastRun()) >= container
.getTick()) {
try {
[COLOR="Red"]container.execute();[/COLOR]
} catch (Exception e){e.printStackTrace();}
}
if (container.getTick() < waitFor || waitFor == -1) {
waitFor = container.getTick();
}
} else {
// add to remove list
remove.add(container);
}
}[/CODE]

So yea im not sure what to do with this because last time i got this error (i think it was this type of error) i increased the array limit or something (been a year since ive coded) but idk. Thanks in advance to any help!

EDIT-

fixed it Edited by killers10333
Fixed

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Sign in to follow this  

×