Thread: [pi] freeze intill player does tut

Results 1 to 7 of 7
  1. #1 [pi] freeze intill player does tut 
    Registered Member
    Join Date
    Nov 2011
    Posts
    167
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Hello, im woundering if anyone can help me with this.

    I added different xp rates and i want to know how to freeze to player intill they pick a mode to play on.

    if you can help me that would be great.
    Reply With Quote  
     

  2. #2  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    PlayerAssistant.java > addSkillXP

    In the first line of this method you would insert or apply a condition that will return if they are still in the process of choosing a 'mode'.

    Code:
    if(!c.hasChosenMode()) {
            if(!c.hasBeenWarned()) {
                    c.sendMessage("You need to choose a mode before you can obtain experience.");
                    c.setHasBeenWarned(true);
            }
            return;
    }
    EDIT: Unfortunately I have read this incorrectly so I will supply a more proper solution.

    Packets > Walking.java

    In the first line of the void place the same method.

    Code:
    if(!c.hasChosenMode()) {
            if(!c.hasBeenWarned()) {
                    c.sendMessage("You need to choose a mode before you can walk anywheres.");
                    c.setHasBeenWarned(true);
            }
            return;
    }
    I would also like to note that you should do this in various other situations like Trading, Following, Attacking, Clicking Various Buttons, etcetera.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2011
    Posts
    167
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Jason View Post
    PlayerAssistant.java > addSkillXP

    In the first line of this method you would insert or apply a condition that will return if they are still in the process of choosing a 'mode'.

    Code:
    if(!c.hasChosenMode()) {
            if(!c.hasBeenWarned()) {
                    c.sendMessage("You need to choose a mode before you can obtain experience.");
                    c.setHasBeenWarned(true);
            }
            return;
    }

    ehh could you maybe do it for me? im really noob at coding :F, heres my addskillxp

    public boolean addSkillXP(int amount, int skill){
    if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) {
    if(c.playerXP[skill] > 200000000) {
    c.playerXP[skill] = 200000000;
    }
    return false;
    }
    /*if (c.Config.SERVER_EXP_BONUS > 0) {
    amount *= Config.SERVER_EXP_BONUS * Config.SERVER_EXP_BONUS;
    } else*/ if (c.rookie == 1000) {
    amount *= 5;
    } else if (c.average == 100) {
    amount *= 3;
    } else if (c.legend == 10) {
    amount *= 1;
    } else if (c.extreme == 1) {
    amount *= 1;
    }
    //amount *= Config.SERVER_EXP_BONUS;
    int oldLevel = getLevelForXP(c.playerXP[skill]);
    c.playerXP[skill] += amount;
    if (oldLevel < getLevelForXP(c.playerXP[skill])) {
    if (c.playerLevel[skill] < c.getLevelForXP(c.playerXP[skill]) && skill != 3 && skill != 5)
    c.playerLevel[skill] = c.getLevelForXP(c.playerXP[skill]);
    levelUp(skill);
    c.gfx100(199);
    requestUpdates();
    }
    setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]);
    refreshSkill(skill);
    return true;
    }
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    I'm sorry but as much as I want to help you my time is very precious. I wish I could help you but there is much more in doing this then you understand. You have to consider various exceptions other than just walking. Best of luck in your endeavours. Btw, If you don't want to be a 'noob coder' I suggest you pickup a book.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2011
    Posts
    167
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Jason View Post
    I'm sorry but as much as I want to help you my time is very precious. I wish I could help you but there is much more in doing this then you understand. You have to consider various exceptions other than just walking. Best of luck in your endeavours. Btw, If you don't want to be a 'noob coder' I suggest you pickup a book.
    What does picking up a book have to do with coding? and thanks for the help.
    Reply With Quote  
     

  6. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by xaronx View Post
    What does picking up a book have to do with coding? and thanks for the help.
    Understand Java is the first step in developing. By picking up a book you're literally enhancing the speed of learning by a magnitude that I can't even express. If you want to learn, apply yourself accordingly. Otherwise, you will end up with a crappy, half assed (^ 2 * 4 / 0) server that will be just like the rest. You're welcome btw. You would insert what I put at the top of the method.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2011
    Posts
    167
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Jason View Post
    Understand Java is the first step in developing. By picking up a book you're literally enhancing the speed of learning by a magnitude that I can't even express. If you want to learn, apply yourself accordingly. Otherwise, you will end up with a crappy, half assed (^ 2 * 4 / 0) server that will be just like the rest. You're welcome btw. You would insert what I put at the top of the method.
    Thank you i have got it working im about to add it in trade, walking etc...
    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. PI players does not lose HP anymore
    By 1defk0 in forum Help
    Replies: 6
    Last Post: 03-22-2013, 11:03 PM
  2. Replies: 12
    Last Post: 04-09-2012, 03:35 PM
  3. Replies: 12
    Last Post: 03-31-2012, 02:50 AM
  4. How many players does this VPS holds?
    By Division in forum Hosting
    Replies: 2
    Last Post: 02-28-2010, 11:48 PM
  5. Replies: 2
    Last Post: 04-22-2009, 01:19 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •