Thread: Limiting the ::anim command to lower than anim 4000? [pi]

Results 1 to 5 of 5
  1. #1 Limiting the ::anim command to lower than anim 4000? [pi] 
    Registered Member
    Join Date
    Mar 2011
    Posts
    87
    Thanks given
    6
    Thanks received
    2
    Rep Power
    1
    Hi, just wondering how i can limit this anim command, so that you can't do any anims above 4000 (which freezes everyone around you).

    Code:
     if (playerCommand.startsWith("anim")  && (c.playerRights >= 2)) {
    		
    				String[] args = playerCommand.split(" ");
    				c.startAnimation(Integer.parseInt(args[1]));
    				c.getPA().requestUpdates();
    			}
    Reply With Quote  
     

  2. #2  
    Registered Member hybrent's Avatar
    Join Date
    Nov 2007
    Posts
    566
    Thanks given
    73
    Thanks received
    90
    Rep Power
    28
    Quote Originally Posted by secret wish View Post
    Hi, just wondering how i can limit this anim command, so that you can't do any anims above 4000 (which freezes everyone around you).

    Code:
     if (playerCommand.startsWith("anim")  && (c.playerRights >= 2)) {
    		
    				String[] args = playerCommand.split(" ");
    				c.startAnimation(Integer.parseInt(args[1]));
    				c.getPA().requestUpdates();
    			}
    Code:
    if (playerCommand.startsWith("anim")  && (c.playerRights >= 2)) {
    		
    				String[] args = playerCommand.split(" ");
                                 if (Integer.parseInt(args[1])) > 4000) {
                                //maybe send a message here?
                                   return; //stops the method from continuing
                                   }
    				c.startAnimation(Integer.parseInt(args[1]));
    				c.getPA().requestUpdates();
    Amused as I am not, I must continue to try. -Keith Charles
    Quote Originally Posted by Ayton View Post
    I'm sorry, but I have to agree with Hybrent.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2011
    Posts
    87
    Thanks given
    6
    Thanks received
    2
    Rep Power
    1
    thanks for help, but getting

    Code:
     src\server\model\players\packets\Commands.java:1228: illegal start of expression
    
                                 if (Integer.parseInt(args[1])) >= 4000) {
                                                                ^
    src\server\model\players\packets\Commands.java:1228: ';' expected
                                 if (Integer.parseInt(args[1])) >= 4000) {
                                                                       ^
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2011
    Posts
    719
    Thanks given
    156
    Thanks received
    91
    Rep Power
    32
    Try removing one of the ")" There is 1 too many I think
    Reply With Quote  
     

  5. #5  
    Registered Member hybrent's Avatar
    Join Date
    Nov 2007
    Posts
    566
    Thanks given
    73
    Thanks received
    90
    Rep Power
    28
    Quote Originally Posted by secret wish View Post
    thanks for help, but getting

    Code:
     src\server\model\players\packets\Commands.java:1228: illegal start of expression
    
                                 if (Integer.parseInt(args[1])) >= 4000) {
                                                                ^
    src\server\model\players\packets\Commands.java:1228: ';' expected
                                 if (Integer.parseInt(args[1])) >= 4000) {
                                                                       ^
    Yeah sorry wrote it in quick-response:

    Change:
    if (Integer.parseInt(args[1])) >= 4000) {
    to
    if (Integer.parseInt(args[1]) >= 4000) {
    Amused as I am not, I must continue to try. -Keith Charles
    Quote Originally Posted by Ayton View Post
    I'm sorry, but I have to agree with Hybrent.
    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. Replies: 25
    Last Post: 11-18-2011, 02:30 AM
  2. Object anim loop(after swats anim header)
    By owner blade in forum Requests
    Replies: 10
    Last Post: 11-03-2010, 10:50 PM
  3. Replies: 14
    Last Post: 10-11-2009, 05:40 AM
  4. Anim Command
    By Bytes Me in forum Configuration
    Replies: 2
    Last Post: 11-09-2008, 06:31 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
  •