|
My problem is when i kill someone i don't gain any pkp neither my current kills change on my quest tab i've looked everywhere every tutorial but i really cant seem to find the problem.
Playerkilling:
if you need more info just tell meCode:package server.model.players; public class PlayerKilling { private Client c; /** * Constructor class */ public PlayerKilling(Client Client) { this.c = Client; } /** * How many people you have to kill before getting points again * for killing the same person. */ public final int NEEDED_KILLS = 10; /** * First the method checks if the array list contains the person * and if it doesn't then add there name but if it does then * return the method false. */ public boolean addPlayer(String i) { if(!c.killedPlayers.contains(i)) { c.killedPlayers.add(i); return true; } return false; } /** * Checking if the array list contains the player and if * the person has killed 20 or more people since that person. */ public void checkForPlayer(String i) { if(c.killedPlayers.contains(i) && c.killedPlayers.indexOf(i) >= NEEDED_KILLS) { c.killedPlayers.remove(i); } } }
go to playerassistant and there should by something like ApplyDead or something like that just search for "Oh Dear, you're dead" and make it so that your killstreak ends there or whatever. Where they kill them just do c.pkPoints += 1; or watever.
where should i add the pkpoints thingy?Code:public void applyDead() { c.respawnTimer = 10; c.isDead = true; 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) { o.pcPoints += 1; <---- i don't get this why is this here 0.o c.playerKilled = c.playerId; if (c.killerId != c.playerId); if (c.inWild()) { int deathMessage = Misc.random(8); if (deathMessage == 0) { o.sendMessage("@red@With a crushing blow, you defeat @blu@" + c.playerName + "!"); } else if (deathMessage == 1) { o.sendMessage("@red@It's a humiliating defeat for @blu@" + c.playerName + "!"); } else if (deathMessage == 2) { o.sendMessage("@red@Do you ever die? Certainly NOT against @blu@" + c.playerName + "!"); } else if (deathMessage == 3) { o.sendMessage("@red@You have defeated @blu@" + c.playerName + "!"); } else if (deathMessage == 4) { o.sendMessage("@red@You have just dropped @blu@" + c.playerName + "!"); } else if (deathMessage == 5) { o.sendMessage("@red@It's all over for @blu@" + c.playerName + "!"); } else if (deathMessage == 6) { o.sendMessage("@red@You have killed @blu@" + c.playerName + "!"); } else if (deathMessage == 7) { o.sendMessage("@red@Can anyone defeat you? Certainly not @blu@" + c.playerName + "!"); } else if (deathMessage == 8) { o.sendMessage("@red@You were clearly a better fighter than @blu@" + c.playerName + "!"); } } if(o.duelStatus == 5) { o.duelStatus++; } } }
and how could i make it so it give random pkp not only 1 or 5 but random pkp's
just add c.pkPoints += 1; aboveif you want a random amount of points per each kill just use Misc.RandomCode:if (deathMessage == 0) {
still not working i've added the random misc but it isnt working i still don't gain pkp my method:
Code:public void applyDead() { c.respawnTimer = 10; c.isDead = true; 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) { o.pcPoints += 1; c.playerKilled = c.playerId; if (c.killerId != c.playerId); if (c.inWild()) { int deathMessage = Misc.random(8); if (deathMessage == 0) { c.pkPoints += 1; o.sendMessage("@red@With a crushing blow, you defeat @blu@" + c.playerName + "!"); } else if (deathMessage == 1) { c.pkPoints = Misc.random(7); o.sendMessage("@red@It's a humiliating defeat for @blu@" + c.playerName + "!"); } else if (deathMessage == 2) { c.pkPoints = Misc.random(7); o.sendMessage("@red@Do you ever die? Certainly NOT against @blu@" + c.playerName + "!"); } else if (deathMessage == 3) { c.pkPoints = Misc.random(7); o.sendMessage("@red@You have defeated @blu@" + c.playerName + "!"); } else if (deathMessage == 4) { c.pkPoints = Misc.random(7); o.sendMessage("@red@You have just dropped @blu@" + c.playerName + "!"); } else if (deathMessage == 5) { c.pkPoints = Misc.random(7); o.sendMessage("@red@It's all over for @blu@" + c.playerName + "!"); } else if (deathMessage == 6) { c.pkPoints = Misc.random(7); o.sendMessage("@red@You have killed @blu@" + c.playerName + "!"); } else if (deathMessage == 7) { c.pkPoints = Misc.random(7); o.sendMessage("@red@Can anyone defeat you? Certainly not @blu@" + c.playerName + "!"); } else if (deathMessage == 8) { c.pkPoints = Misc.random(7); o.sendMessage("@red@You were clearly a better fighter than @blu@" + c.playerName + "!"); } } if(o.duelStatus == 5) { o.duelStatus++; } } }
here my apply dead
public void applyDead() {
c.respawnTimer = 12;
c.isDead = false;
if(c.duelStatus != 6) {
c.killerId = findKiller();
Client o = (Client) PlayerHandler.players[c.killerId];
if(o != null) {
if(!PlayerKilling.hostOnList(o, c.connectedFrom)) {
PlayerKilling.addHostToList(o, c.connectedFrom);
o.pkp += 1;
o.KC += 1;
o.cStreak += 1;
o.sendMessage("Your Player Killing Statistics has been updated:");
o.sendMessage("Pk Points: <col=255>"+c.pkp+"</col>|| Current Killstreak: <col=255>"+c.hStreak+"</col>.");
if(o.cStreak > o.hStreak) {
o.hStreak = o.cStreak;
o.sendMessage("<col=255>Congratulations, your Hightest kill streak has increased!");
}
} else {
o.sendMessage("Because you have recently killed " + Misc.capitalize(c.playerName) + " you do not recieve Pk points.");
}
o.playerKilled = c.playerId;
if(o.duelStatus == 5) {
o.duelStatus++;
}
}
}
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |