k... just turn off teh pc and go bowling. lol
|
Okay,
So I edited the killingstreak class found on this tut: http://www.rune-server.org/runescape...tem-100-a.html
Okay heres my void I created
But it throws a nullpointer, because if the int reward is o.killstreak times cash.Code:public void Rewards() { Client o = (Client) PlayerHandler.players[c.killerId]; int cash = 1000000; //1M int maxks = 100; int reward = o.killStreak * cash; if(o != null) { if(o.killStreak > 0) { c.getItems().addItem(4067, reward); } else if(c.killStreak == maxks) { yell("<col=16711680>PvP System:</col> "+c.playerName+" has Reached Maxed Killstreak! He is Rewarded 250 GSP"); c.pkPoints += 250; } } }
But when the player dies, it sets his killstreak to 0 therefore you are getting a reward of 0.
So I need to figure out how to make it where you get in a range between certain hp levels it will save as a variable.
So that way int reward could be changed to o.newvarmade * cash.
I hope that makes sense.. Its hard to explain
k... just turn off teh pc and go bowling. lol
Why are you using o. then switching to c. for the same player? and instead of making cash a variable just put (1000000*c.killStreak) and why are you using o != null the player will be on no matter what if it calls if cus it should be checking kills first either way
You're using o before you check if it's null.
Oh ok i see what you mean..
public void Rewards() {
Client o = (Client) PlayerHandler.players[c.killerId];
int cash = 1000000; //1M
int maxks = 100;
int reward;
if(o != null) {
if(o.killStreak > 0 && c.killStreak != maxks) {
reward = o.killStreak * cash;
c.getItems().addItem(4067, reward);
} else if(c.killStreak == maxks) {
yell("<col=16711680>PvP System:</col> "+c.playerName+" has Reached Maxed Killstreak! He is Rewarded 250 GSP");
c.pkPoints += 250;
}
}
}
Just like null said its being was called before hand
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |