Seems like the command works fine for me.
Code:for(int i = 0; i < 24; i++) { if(c.playerXP[i] >= getLevelForXP(10) && c.playerXP[i] <= getLevelForXP(19)) { c.getItems().addItem(20754); return;
|
When using this it only checks if the first skill 0 (Attack) is at level 10, what am i doing wrong that makes it stop there and not check all skills?Code:for(int i = 0; i < 24; i++) { if(c.playerXP[i] >= getLevelForXP(10) && c.playerXP[i] <= getLevelForXP(19)) { c.getItems().addItem(20754); return;
Seems like the command works fine for me.
Code:for(int i = 0; i < 24; i++) { if(c.playerXP[i] >= getLevelForXP(10) && c.playerXP[i] <= getLevelForXP(19)) { c.getItems().addItem(20754); return;
Not sure if I understand the purpose of the code, but try changing return; to continue;
return; will break the loop but continue; will "skip" to next one
Code:if(c.playerXP[i] >= getLevelForXP(10) && c.playerXP[i] <= getLevelForXP(19)) { c.getItems().addItem(20754); return;that's what your code is doing. post the whole thing if you'd like some more clarificationCode:if(this is true) { //if this is right c.additem;//then do this return;//then end loop
Because of:
Code:for(int i = 0; i < 24; i++) { if(c.playerXP[i] >= getLevelForXP(10) && c.playerXP[i] <= getLevelForXP(19)) { c.getItems().addItem(20754); return;
I don't know what you're trying to do and that makes no sense because you're checking players xp in a given skill against the level in that skill? Xp and Level are 2 diff measures.
You can do either of the following:
1) You're checking if a players xp in a given skill meets the xp they are supposed to have for levels between 10 to 19.
2) Here you're checking if a players level in a given skill is between 9 - 20.Code:for(int i = 0; i < 24; i++) { if(c.playerXP[i] >= getXPForLevel(10) && c.playerXP[i] <= getXPForLevel(19)) c.getItems().addItem(20754); }
Go with the one that meets your need.Code:for(int i = 0; i < 24; i++) { if(c.playerLevel[i] > 9 && c.playerLevel[i] < 20) c.getItems().addItem(20754); }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |