Do something like this:
I think that will work for delta.Code:if(command.equalsIgnoreCase("resetdefence"){ playerLevel[2] == 1; sM("You resetted your defence level to 1"); }
|
Is there any way to do this? I cant work out how
Dunno why this shouldnt work it works for me enjoy!
if (command.startsWith("resetdef") && playerRights >= 3) {
String name = command.substring(9);
try {
int p = PlayerHandler.getPlayerID(name);
client c = (client) server.playerHandler.players[p];
c.playerLevel[1] = 1;
c.setSkillLevel(i, 1, playerLevel[1]);
c.playerXP[1] = 1;
savegame(true);
c.disconnected = true;
sM("You just made "+command.substring(9)+" ONE-DEF.");
} catch(Exception e) {
sM(name+" either isn't online or doesn't exist");
}
}
^seans should work, vinces just changes the level and not the xp, so its technically not reset.
heres the one i have on my server:
Code:if (command.equalsIgnoreCase("resetdef")) { if(playerXP[1] > 10000){sM("Your defence is not low enough to be considered glitched!");return;} for(int r=0; r<playerEquipment.length; r++) { int item = playerEquipment[r]; if((item > 0) && (item < 19999)) {sM("Please remove ALL armor and weapons before using this command!");return;} }
Videl yours wouldnt work...
if (command.equalsIgnoreCase("resetdef")) {
if(playerXP[1] > 1999999999){sM("Your defence is not in the xp range!");return;}
for(int r=0; r<playerEquipment.length; r++) {
int item = playerEquipment[r];
if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
}if (command.equalsIgnoreCase("resetstr")) {
if(playerXP[2] > 1999999999){sM("Your strenght is not in the xp range!");return;}
for(int r=0; r<playerEquipment.length; r++) {
int item = playerEquipment[r];
if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
}Enjoyif (command.equalsIgnoreCase("resetattack")) {
if(playerXP[0] > 1999999999){sM("Your Attack is not in the xp range!");return;}
for(int r=0; r<playerEquipment.length; r++) {
int item = playerEquipment[r];
if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
}
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |