Try to make booleans like c.sit = false; etc...
|
So I had a nice idea to change the idlelogout class with this
However when the http://gyazo.com/3a65ed220c89793880540d460b16b82f player starts the animation, they are unable to move. What would be the most efficient way to solve thisCode:public class IdleLogout implements PacketType { public void processPacket(Client c, int packetType, int packetSize) { if (c.playerRights <= 1) { c.startAnimation(4111); } else if (c.playerRights == 3) { c.startAnimation(4117); } else if (c.playerRights >=4) { c.startAnimation(4114); } } }
Try to make booleans like c.sit = false; etc...
bump
Basically learn from this command
Code:if (playerCommand.startsWith("afk") && c.sit == false) { if(c.inWild()) { c.sendMessage("Er, it's not to smart to go AFK in the Wilderness..."); return; } c.sit = true; if(c.playerRights == 0) { c.startAnimation(4117); c.forcedText = "DONT ****ING DISTURB ME BUSY AS ****"; c.forcedChatUpdateRequired = true; c.updateRequired = true; c.sendMessage("When you return type ::back, you cannot move while AFK is on."); } if(c.playerRights == 2 || c.playerRights == 3) { c.startAnimation(4117); c.forcedText = "DONT ****ING DISTURB ME BUSY AS ****"; c.forcedChatUpdateRequired = true; c.updateRequired = true; c.sendMessage("When you return type ::back, you cannot move while AFK is on."); } if(c.playerRights == 2 || c.playerRights == 2) { c.startAnimation(4117); c.forcedText = "DONT ****ING DISTURB ME BUSY AS ****"; c.forcedChatUpdateRequired = true; c.updateRequired = true; c.sendMessage("When you return type ::back, you cannot move while AFK is on."); } if(c.playerRights == 4) { c.startAnimation(4117); c.forcedText = "DONT ****ING DISTURB ME BUSY AS ****"; c.forcedChatUpdateRequired = true; c.updateRequired = true; c.sendMessage("When you return type ::back, you cannot move while AFK is on."); }
Its telling you to update the forcechat and you should able to walk due to this code. Just simply add the booleans sit = false in player.java and add it to your idlelogout method. sit = false; etc..
What's happening is the animation you're using doesn't have a set stopping point, so if you try to move or something while using that method of making a player do an animation they won't be able to. If you have some sort of method in your server to cancel/stop animations, you can keep your idle packet exactly how it is (except initialize something like public boolean playerAfk = false; in your player.java file and set it to true when they go AFK) and then in your method for clicking/walking/attacking add an if statement checking to see if then playerAfk variable is true, and if it is set it to false and cancel the animation.
Also,
Just posting that command by itself is useless. If you want to tell him to learn something, post the ::back command, post what changes were made in player.java, etc. That command is almost meaningless haha
EDIT:
I fixed it. Needed to add in walking.java under the if sit == true etcCode:resetAnimation
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |