c.getItems().deleteItem(ItemID, 1); Needs to be a item id there.
|
i'm trying to make an item which boosts your stats for admins.
This is the error i'm getting:
And this is my code:
case 774:
if (c.playerRights < 2) {
c.sendMessage("How did you get this item?");
c.getItems().deleteItem(ItemID, 1);
} else {
c.getPA().requestUpdates();
c.playerLevel[0] = 126;
c.getPA().refreshSkill(0);
c.playerLevel[1] = 126;
c.getPA().refreshSkill(1);
c.playerLevel[2] = 126;
c.getPA().refreshSkill(2);
c.playerLevel[3] = 99999999;
c.getPA().refreshSkill(3);
c.playerLevel[4] = 122;
c.getPA().refreshSkill(4);
c.playerLevel[5] = 99999999;
c.getPA().refreshSkill(5);
c.playerLevel[6] = 106;
c.getPA().refreshSkill(6);
c.getItems().updateSpecialBar();
c.specAmount = 100000000;
}
break;
Also, if someone could also add the code so i can have an option to teleport somewhere with this item, that would be awesome.
Free rep to anyone who is able to help me.
c.getItems().deleteItem(ItemID, 1); Needs to be a item id there.
done that, now i don't get an compile error but the item won't do as i coded it to.
i have this in itemdef: case 774:
itemDef.name = "Admin's pendant";
itemDef.description ="A useful pendant for administrators.".getBytes();
itemDef.actions = new String[5];
itemDef.actions[2] = "Admin Zone";
itemDef.actions[3] = "Boost stats";
break;
and this in itemclick2: case 774:
if (c.playerRights < 2) {
c.sendMessage("How did you get this item?");
c.getItems().deleteItem(774, 1);
} else {
c.getPA().requestUpdates();
c.playerLevel[0] = 126;
c.getPA().refreshSkill(0);
c.playerLevel[1] = 126;
c.getPA().refreshSkill(1);
c.playerLevel[2] = 126;
c.getPA().refreshSkill(2);
c.playerLevel[3] = 99999999;
c.getPA().refreshSkill(3);
c.playerLevel[4] = 122;
c.getPA().refreshSkill(4);
c.playerLevel[5] = 99999999;
c.getPA().refreshSkill(5);
c.playerLevel[6] = 106;
c.getPA().refreshSkill(6);
c.getItems().updateSpecialBar();
c.specAmount = 100000000;
}
break;
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |