Thread: [Simple] Neater version of this code/HP and Prayer not refreshing

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [Simple] Neater version of this code/HP and Prayer not refreshing 
    Registered Member
    Join Date
    Jul 2011
    Posts
    537
    Thanks given
    25
    Thanks received
    35
    Rep Power
    0
    Ok so this is the code i have

    Code:
    case 13447:
    			c.getPA().addSkillXP((110000), 0);
    			c.getPA().addSkillXP((110000), 1);
    			c.getPA().addSkillXP((110000), 2);
    			c.getPA().addSkillXP((110000), 3);
    			c.getPA().addSkillXP((110000), 4);
    			c.getPA().addSkillXP((110000), 5);
    			c.getPA().addSkillXP((110000), 6);
    			c.getPA().refreshSkill(3);
    			c.getPA().refreshSkill(5);
    			c.sendMessage("You rub the lamp and you receive some experience!");
    			c.getItems().deleteItem(13447,1);
    		break;
    When i rub the lamp, my hp stays at like 10 and prayer stays at 1.

    Also i've seen ways that people make 'addskillxp' codes much neater but i don't know how to do it.


    Thanks.
    I support Eliminate.


    [Today 06:28 PM] Scu11: Mans gotta spread his wings, to do his tings
    Reply With Quote  
     

  2. #2  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    423
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    IMO, I think you should let the player select the skill he/she wants to add experience to, or do you want to do something else with the lamp?
    if so, try this:
    Code:
    case 13447:
    			c.getPA().addSkillXP((110000), 0);
    			c.getPA().addSkillXP((110000), 1);
    			c.getPA().addSkillXP((110000), 2);
    			c.getPA().addSkillXP((110000), 3);
    			c.getPA().addSkillXP((110000), 4);
    			c.getPA().addSkillXP((110000), 5);
    			c.getPA().addSkillXP((110000), 6);
    			c.sendMessage("You rub the lamp and you receive some experience!");
    			c.getItems().deleteItem(13447,1);
                            c.getPA().refreshSkill(3);
    			c.getPA().refreshSkill(5);
    		break;
    Refreshing/reseting should be at the end of the process

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2011
    Posts
    537
    Thanks given
    25
    Thanks received
    35
    Rep Power
    0
    Quote Originally Posted by Da D4v1nci C0de View Post
    IMO, I think you should let the player select the skill he/she wants to add experience to, or do you want to do something else with the lamp?
    if so, try this:
    Code:
    case 13447:
    			c.getPA().addSkillXP((110000), 0);
    			c.getPA().addSkillXP((110000), 1);
    			c.getPA().addSkillXP((110000), 2);
    			c.getPA().addSkillXP((110000), 3);
    			c.getPA().addSkillXP((110000), 4);
    			c.getPA().addSkillXP((110000), 5);
    			c.getPA().addSkillXP((110000), 6);
    			c.sendMessage("You rub the lamp and you receive some experience!");
    			c.getItems().deleteItem(13447,1);
                            c.getPA().refreshSkill(3);
    			c.getPA().refreshSkill(5);
    		break;
    Refreshing/reseting should be at the end of the process
    You're totally right about letting the player decide but this is only a small thing atm, i'll eventually add an interface.
    I support Eliminate.


    [Today 06:28 PM] Scu11: Mans gotta spread his wings, to do his tings
    Reply With Quote  
     

  4. #4  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    423
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    There should be an interface ID already in your client.

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

  5. #5  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    Quote Originally Posted by Da D4v1nci C0de View Post
    IMO, I think you should let the player select the skill he/she wants to add experience to, or do you want to do something else with the lamp?
    if so, try this:
    Code:
    case 13447:
    			c.getPA().addSkillXP((110000), 0);
    			c.getPA().addSkillXP((110000), 1);
    			c.getPA().addSkillXP((110000), 2);
    			c.getPA().addSkillXP((110000), 3);
    			c.getPA().addSkillXP((110000), 4);
    			c.getPA().addSkillXP((110000), 5);
    			c.getPA().addSkillXP((110000), 6);
    			c.sendMessage("You rub the lamp and you receive some experience!");
    			c.getItems().deleteItem(13447,1);
                            c.getPA().refreshSkill(3);
    			c.getPA().refreshSkill(5);
    		break;
    Refreshing/reseting should be at the end of the process
    It doesn't matter when you refresh the skill...As long as it is after you add the experience.


    Reply With Quote  
     

  6. #6  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    423
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    Oh, ok. Sorry, I've been away for a while.

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2011
    Posts
    537
    Thanks given
    25
    Thanks received
    35
    Rep Power
    0
    Your code didn't work D4v1nci.

    Anyone else?
    I support Eliminate.


    [Today 06:28 PM] Scu11: Mans gotta spread his wings, to do his tings
    Reply With Quote  
     

  8. #8  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    423
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    You might want to do what I suggested earlier, I can provide you with the code.

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jul 2011
    Posts
    537
    Thanks given
    25
    Thanks received
    35
    Rep Power
    0
    Quote Originally Posted by Da D4v1nci C0de View Post
    You might want to do what I suggested earlier, I can provide you with the code.
    Sure.
    I support Eliminate.


    [Today 06:28 PM] Scu11: Mans gotta spread his wings, to do his tings
    Reply With Quote  
     

  10. #10  
    Registered Member Da D4v1nci C0de's Avatar
    Join Date
    Jul 2010
    Posts
    423
    Thanks given
    128
    Thanks received
    30
    Rep Power
    56
    Alright, just gimme a sec

    Quote Originally Posted by atsiv3 View Post
    When I see your name login to my server, I will ban you.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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: 4
    Last Post: 07-16-2010, 06:56 PM
  2. [Any Version/Source] Server GUI [Simple]
    By 'Hunter in forum Tutorials
    Replies: 11
    Last Post: 02-23-2010, 05:05 AM
  3. full specials (smaller and neater version)
    By killamess in forum Tutorials
    Replies: 42
    Last Post: 02-05-2009, 09:49 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
  •