Jump to content
  • 0
Sign in to follow this  

PI zombie minigame help


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 -

[CODE][2/19/12 10:24 AM]: at server.model.minigames.ZombieMiniGame.spawnNextRound(
[2/19/12 10:24 AM]: at server.model.npcs.NPCHandler$2.execute(NPCHandler.jav
[2/19/12 10:24 AM]: at server.event.EventContainer.execute(EventContainer.ja
[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

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


EventCOntainer -
[CODE]public void execute() {
this.lastRun = System.currentTimeMillis();

EventManager -

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

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!


fixed it Edited by killers10333

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