Thread: Afk mode

Results 1 to 7 of 7
  1. #1 Afk mode 
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    So I had a nice idea to change the idlelogout class with this
    Code:
    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);
    			
    		}
    	}
    }
    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 this
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2014
    Posts
    813
    Thanks given
    69
    Thanks received
    47
    Rep Power
    9
    Try to make booleans like c.sit = false; etc...
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    bump
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2014
    Posts
    813
    Thanks given
    69
    Thanks received
    47
    Rep Power
    9
    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..
    Reply With Quote  
     

  5. #5  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    30
    Posts
    2,660
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    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,
    Quote Originally Posted by Boolean- View Post
    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..
    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


    `Ex-global moderator x3 (resigned)
    Reply With Quote  
     

  6. #6  
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    Quote Originally Posted by Runite View Post
    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
    hey thanks again, where would this method be or what should i be searching for? (PI source)
    Reply With Quote  
     

  7. #7  
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    EDIT:
    I fixed it. Needed to add in walking.java under the if sit == true etc
    Code:
    resetAnimation
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Afk = Logout
    By Dance in forum Tutorials
    Replies: 15
    Last Post: 02-10-2008, 05:22 PM
  2. Halo 3 Legendary Mode With Me??
    By LILACE5599 in forum Console
    Replies: 11
    Last Post: 01-08-2008, 11:42 PM
  3. Idle Mode
    By × Se×pert × in forum Tutorials
    Replies: 13
    Last Post: 12-29-2007, 02:40 AM
  4. [Release] Mode One's Client
    By M0d3 0n3 in forum Downloads
    Replies: 12
    Last Post: 05-19-2007, 12:44 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •