Thread: [PI/DSPK] PK Point on Death and not Kill?

Results 1 to 4 of 4
  1. #1 [PI/DSPK] PK Point on Death and not Kill? 
    Registered Member
    Join Date
    Jan 2011
    Posts
    40
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    How can I make it give me a pk point when I kill someone it only gives it when I die...

    Code:
        public void applyDead() {    
            c.respawnTimer = 15;
            c.isDead = false;
            
            if(c.duelStatus != 6) {
                c.killerId = c.getCombat().getKillerId(c.playerId);
                c.killerId = findKiller();
                Client o = (Client) Server.playerHandler.players[c.killerId];
                if(o != null) {
                    if(!(c.npcIndex > 0) && c.inPits == false){
                    }
                    if (c.killerId != c.playerId)
                        o.sendMessage("You have defeated "+Misc.optimizeText(c.playerName)+"!");
                                    if(c.inWild()){
                                            c.pkPoints += 1;
                                            o.sendMessage("You have received 1 PkPoint, you now have "+c.pkPoints+" pk points!");
                                    }
                    c.playerKilled = c.playerId;
                    if(o.duelStatus == 5) {
                        o.duelStatus++;
                    }
                }
            }
            c.faceUpdate(0);
            c.npcIndex = 0;
            c.playerIndex = 0;
            c.stopMovement();
            if(c.duelStatus <= 4) {
                c.sendMessage("Oh dear you are dead!");
            } else if(c.duelStatus != 6) {
                c.sendMessage("You have lost the duel!");
            }
            resetDamageDone();
            c.specAmount = 10;
            c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
            c.lastVeng = 0;
            c.vengOn = false;
            resetFollowers();
            c.attackTimer = 10;
        }
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Oct 2010
    Posts
    33
    Thanks given
    0
    Thanks received
    9
    Rep Power
    0
    If I read this correctly the C = the player who died, So try o.pkPoints += 1;

    Plus I would suggest you making a getter and setter for them..
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Oct 2010
    Posts
    1,730
    Thanks given
    56
    Thanks received
    97
    Rep Power
    0
    replace your applydead method with this:
    Code:
    	public void applyDead() {	
    		c.respawnTimer = 15;
    		c.isDead = false;
    		if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			Client o = (Client) Server.playerHandler.players[c.killerId];
    			if(o != null) {
    			if(!(c.npcIndex > 0) && c.inPits == false){
    				c.DC++;
    				o.KC++;
    				}
    				c.playerKilled = c.playerId;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.killerId].connectedFrom == Server.playerHandler.players[c.playerKilled].connectedFrom && c.inWild()) {
    				//if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled) {
    					o.pkPoints = (o.pkPoints + 1);
    					o.sendMessage("You have killed " +c.playerName+"!.");
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    					o.sendMessage("PkP: "+c.pkPoints+" K: "+c.KC+" D: "+c.DC+"");
    				} else {
    					o.sendMessage("You have killed " +c.playerName+"!");
    					o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    					o.sendMessage("PkP: "+c.pkPoints+" K: "+c.KC+" D: "+c.DC+"");
    					//sendFrame126("PkP: "+c.pkPoints+" K: "+c.KC+" D: "+c.DC+"", 663);
    				}
    			}
    		}
    		c.faceUpdate(0);
    		c.npcIndex = 0;
    		c.playerIndex = 0;
    		c.stopMovement();
    		if(c.duelStatus <= 4) {
    			c.sendMessage("Oh dear you are dead!");
    		} else if(c.duelStatus != 6) {
    			c.sendMessage("You have lost the duel!");
    		}
    		resetDamageDone();
    		c.specAmount = 10;
    		c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
    		c.lastVeng = 0;
    		resetTb();
    		c.getCombat().resetCurse();
    		c.vengOn = false;
    		resetFollowers();
    		c.attackTimer = 10;
    		
    	}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2011
    Posts
    40
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Thanks guys. i have to replace the o with c. Thanks so much.
    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. [DSPK] pk point problem REPPING
    By Faqqot Jr in forum Help
    Replies: 16
    Last Post: 01-19-2011, 02:25 PM
  2. Kill/Death Ratio on Website
    By TORONTO in forum Show-off
    Replies: 17
    Last Post: 12-23-2010, 10:51 PM
  3. Kill to death ratio.
    By The Situationist in forum Help
    Replies: 6
    Last Post: 09-28-2010, 03:07 AM
  4. [Pi] Pk point/kill/death ratio scoreboard 10$
    By Drastic Pk in forum Help
    Replies: 4
    Last Post: 09-25-2010, 02:46 PM
  5. [562] NPC Death resulting in a point/kill+?
    By .alycia in forum Requests
    Replies: 0
    Last Post: 08-06-2010, 08:04 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
  •