Thread: [PI] Pking rewards... after a kill.

Results 1 to 3 of 3
  1. #1 [PI] Pking rewards... after a kill. 
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Alright so I've been messing around in my playerassistant.java with what you get after you kill a player.

    if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {

    if (c.isDonator == 1) {
    o.getItems().addItem(995, 1700000);
    } else {
    o.getItems().addItem(995, 850000);
    }
    //o.killStreak += 1;
    o.sendMessage("You recieved some cash.");
    o.sendMessage("You have defeated " +Misc.optimizeText(c.playerName)+ "!");
    o.getPA().addSkillXP(9000, 23);
    }
    if (o.earningPotential >= 85) {
    o.earningPotential -= 40 + Misc.random(50);
    int random = (int)(Math.random() * (xEP.length - 1));
    Server.itemHandler.createGroundItem(o, xEP[random][0], c.absX, c.absY,
    xEP[random][1], o.playerId);
    o.sendMessage("You recieved an EP drop.");
    o.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }
    if (o.earningPotential >= 85) {
    o.earningPotential -= 40 + Misc.random(50);
    int random = (int)(Math.random() * (xEP.length - 1));
    Server.itemHandler.createGroundItem(o, xEP[random][0], c.absX, c.absY,
    xEP[random][1], c.playerId);
    o.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    }
    My purpose it to make it so that a donor will get 1.7m when they get a kill, but however this isn't working correct. What it is actually saying is "If you kill a donor you get 1.7m, but if you kill a normal player you get 850k" I want it to be if you are a donor and you kill any type of player you get 1.7m and if you are a normal player and you kill someone in pvp you get 850k. Can anyone point out this flawed code's problem? thanks.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by always View Post
    Alright so I've been messing around in my playerassistant.java with what you get after you kill a player.



    My purpose it to make it so that a donor will get 1.7m when they get a kill, but however this isn't working correct. What it is actually saying is "If you kill a donor you get 1.7m, but if you kill a normal player you get 850k" I want it to be if you are a donor and you kill any type of player you get 1.7m and if you are a normal player and you kill someone in pvp you get 850k. Can anyone point out this flawed code's problem? thanks.
    o.isDonator?
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Jul 2012
    Posts
    361
    Thanks given
    185
    Thanks received
    9
    Rep Power
    25
    Quote Originally Posted by Karma_K View Post
    o.isDonator?
    I'll try that.

    Hey well what do you know, it worked
    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 all npcs spawn at once after being killed
    By youngy_james in forum Help
    Replies: 8
    Last Post: 03-24-2012, 05:22 PM
  2. Replies: 6
    Last Post: 06-14-2011, 10:47 PM
  3. Replies: 26
    Last Post: 03-02-2011, 07:25 PM
  4. Replies: 10
    Last Post: 02-24-2011, 01:03 PM
  5. Pking Reward System
    By Fire Wolf in forum Configuration
    Replies: 11
    Last Post: 11-18-2007, 01:37 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
  •