Thread: ruse npcdeathtask

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 ruse npcdeathtask 
    Registered Member
    Join Date
    Oct 2017
    Posts
    24
    Thanks given
    10
    Thanks received
    0
    Rep Power
    11
    trying to make pengs give prestige points when the NPC 131 (penguine) is dead

    Class Npcdeathtask

    if(npc.getId() == 131) {
    killer.setPrestigePoints(killer.getPrestigePoints( ) + 2);
    killer.sendMessage("<img=0>You now have @red@" + killer.getPrestigePoints() + " Prestige Points!");
    }





    Class Player

    public int getPrestigePoints() {
    // TODO Auto-generated method stub
    return 4;
    }

    public void setPrestigePoints(int i) {
    // TODO Auto-generated method stub
    }
    }




    so Far all that happens in game say that it display in red saying I have 4 Prestige points but when i do check my prestige points its not actually working correctly no prestige points have been added please somebody fix or guide me to the way I want it to be not just display it red text I want to be able to get the prestige points
    THANKS will be!
    Reply With Quote  
     

  2. #2  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000


    Code:
    public int getPrestigePoints() {
    // TODO Auto-generated method stub
    return 4;
    }
    
    public void setPrestigePoints(int i) {
    // TODO Auto-generated method stub
    }

    I don't think you need me here to tell you what's wrong with these pieces of code.
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member

    Join Date
    Oct 2011
    Posts
    2,084
    Thanks given
    0
    Thanks received
    1,043
    Rep Power
    3608
    Quote Originally Posted by runeline2 View Post
    somebody fix or guide me to the way
    Quote Originally Posted by Kris View Post


    Code:
    public int getPrestigePoints() {
    // TODO Auto-generated method stub
    return 4;
    }
    
    public void setPrestigePoints(int i) {
    // TODO Auto-generated method stub
    }

    I don't think you need me here to tell you what's wrong with these pieces of code.
    i believe kris just guided u de wey.

    Spoiler for :
    Attached image


    your c0de is incomplete.
    Reply With Quote  
     

  5. #4  
    Registered Member
    thing1's Avatar
    Join Date
    Aug 2008
    Posts
    2,111
    Thanks given
    131
    Thanks received
    1,099
    Rep Power
    2402
    Code:
    private int prestigePoints;
    
    public int getPrestigePoints() {
         return prestigePoints;
    }
    
    public void setPrestigePoints(int prestigePoints) {
         this.prestigePoints = prestigePoints;
    }
    Hope this is helpful
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Oct 2017
    Posts
    24
    Thanks given
    10
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Kris View Post


    Code:
    public int getPrestigePoints() {
    // TODO Auto-generated method stub
    return 4;
    }
    
    public void setPrestigePoints(int i) {
    // TODO Auto-generated method stub
    }

    I don't think you need me here to tell you what's wrong with these pieces of code.

    Please explain I have been trying all night long every way i can possibly think of still does not do what Its suppose to do

    Quote Originally Posted by thing1 View Post
    Code:
    private int prestigePoints;
    
    public int getPrestigePoints() {
         return prestigePoints;
    }
    
    public void setPrestigePoints(int prestigePoints) {
         this.prestigePoints = prestigePoints;
    }
    Hope this is helpful
    I have tried this before It wont work even though on eclipse its not showing any errors but when i load the server and kill NPC 131 (peng) it does not give any prestige points WHY?
    Reply With Quote  
     

  7. #6  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by runeline2 View Post
    Please explain I have been trying all night long every way i can possibly think of still does not do what Its suppose to do



    I have tried this before It wont work even though on eclipse its not showing any errors but when i load the server and kill NPC 131 (peng) it does not give any prestige points WHY?
    If you apply what thing1 provided you and use this code from your OP
    Code:
    if(npc.getId() == 131) {
    killer.setPrestigePoints(killer.getPrestigePoints( ) + 2);
    killer.sendMessage("<img=0>You now have @red@" + killer.getPrestigePoints() + " Prestige Points!");
    }
    It's guaranteed to work, as long as that message is being sent on the kill. (If not, this piece of code is never being reached which is the problem to begin with.
    Attached image
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    Oct 2017
    Posts
    24
    Thanks given
    10
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Kris View Post
    If you apply what thing1 provided you and use this code from your OP
    Code:
    if(npc.getId() == 131) {
    killer.setPrestigePoints(killer.getPrestigePoints( ) + 2);
    killer.sendMessage("<img=0>You now have @red@" + killer.getPrestigePoints() + " Prestige Points!");
    }
    It's guaranteed to work, as long as that message is being sent on the kill. (If not, this piece of code is never being reached which is the problem to begin with.

    Okay I did that, no errors it does display that I have 2 prestige points but when I check still on the same points from before So I'm assuming something is still missing although when I prestige a skill it works but that's not what we are after.

    Quote Originally Posted by thing1 View Post
    Code:
    private int prestigePoints;
    
    public int getPrestigePoints() {
         return prestigePoints;
    }
    
    public void setPrestigePoints(int prestigePoints) {
         this.prestigePoints = prestigePoints;
    }
    Hope this is helpful

    I have already tried that before still no good! please help!

    Quote Originally Posted by thing1 View Post
    Code:
    private int prestigePoints;
    
    public int getPrestigePoints() {
         return prestigePoints;
    }
    
    public void setPrestigePoints(int prestigePoints) {
         this.prestigePoints = prestigePoints;
    }
    Hope this is helpful
    Please help I have added this and Kris is codes still dont seem to be getting the prestige points?

    Still need help with this as the code is not showing errors but it is displaying when i kill the npc it shows 2 Prestige points, but when i check my player panel it does not give prestige points
    Reply With Quote  
     

  9. #8  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Does it reset the points upon logout or is it not adding at all while online?


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Oct 2017
    Posts
    24
    Thanks given
    10
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    Does it reset the points upon logout or is it not adding at all while online?
    It is not adding at all but does display on chat
    Reply With Quote  
     

  11. #10  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by runeline2 View Post
    It is not adding at all but does display on chat
    Thing is if you've not made it store in a player's save file then it'll reset the points when log out.
    However it should set the points if you have done it correct while ingame.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. Looking to join /Ruse | PI\
    By RS Wiki in forum Requests
    Replies: 73
    Last Post: 11-26-2016, 09:05 PM
  2. Replies: 32
    Last Post: 09-08-2015, 06:23 PM
  3. Replies: 171
    Last Post: 07-24-2015, 12:21 PM
  4. Ruse - Looking for Beta testers!
    By RusePS in forum Buying
    Replies: 23
    Last Post: 06-25-2015, 04:11 AM
  5. You raff you ruse?
    By Lenin in forum Spam
    Replies: 16
    Last Post: 11-26-2012, 03:55 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
  •