Try adding a return at the end.
|
why does my fishign event stop after 6 seconds? it doesn't repeat.... it just stops after 6 seconds and doesn't continue.... nothign gets added etc..
heres the fishing event
I mean it should be repeating everytime it ends but it doesn't?? will rep++and thank-Code:public void fishingEvent() { EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer a) { if (Server.FishingHandler.EmoteTimer > 0) { Server.FishingHandler.EmoteTimer--; } else if (Server.FishingHandler.EmoteTimer == 0 && Server.FishingHandler.FishTimer > 0) { resetAnimation(); Server.FishingHandler.FishEmote(playerId); Server.FishingHandler.EmoteTimer = 6; } if (Server.FishingHandler.FishTimer > 0) { Server.FishingHandler.FishTimer--; } else if (Server.FishingHandler.FishTimer == 0) { Server.FishingHandler.Fishing(playerId); } } }, 2000); }
Try adding a return at the end.
did it work?
nope
You need to loop the anim
how would i do that?
i'm not sure, but I think you might have to add a while loop like this :
Code:public void fishingEvent() { EventManager.getSingleton().addEvent(new Event() { public void execute(EventContainer a) { while(playerIsFishing) { if (Server.FishingHandler.EmoteTimer > 0) { Server.FishingHandler.EmoteTimer--; } else if (Server.FishingHandler.EmoteTimer == 0 && Server.FishingHandler.FishTimer > 0) { resetAnimation(); Server.FishingHandler.FishEmote(playerId); Server.FishingHandler.EmoteTimer = 6; } if (Server.FishingHandler.FishTimer > 0) { Server.FishingHandler.FishTimer--; } else if (Server.FishingHandler.FishTimer == 0) { Server.FishingHandler.Fishing(playerId); } } } }, 2000); }
aint i tried that and it gave me an error and when i tried to decalare that i gotCode:Client.java:19: cannot find symbol symbol: variable playerIsFishing while(playerIsFishing) { ^ 1 error Press any key to continue . . .
sorry if it seems basic just trying to learnCode:Client.java:19: incompatible types found : int required: boolean while(playerIsFishing) { ^ 1 error Press any key to continue . . .
yeah, ofcourse you gotta declare a variable called playerIsFishing and set that variale to true when a player clicked a fishing spot and set it back to false when he walks away/drop item/trade player/followplayer...
EDIT :Oh yeah, if you don't know how to declare the variable simple : public boolean playerIsFishing = false;
If your declaring that in player.java you'll have to change the while(playerIsFishing) { to while(c.playerIsFishing) {
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |