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..
|
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; }
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..
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; }
Thanks guys. i have to replace the o with c. Thanks so much.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |