bump
|
Hello there,
I am using the Z508 base, I followed a tutorial for adding donator's, it worked out good and no error's everything works also, I wanted to increase the donator package to get more peaple to buy it.
I am adding non-combat skills (Thieving, Woodcutting, Mining, ETC.) and I wanted that those could not be set wit the ::lvl id xpammount command...
However I wanted that Donators could, So I changed this in my ::lvl id xpammount command:
What did I do wrong in the code?Code:if (cmd[0].equals("lvl")) { int level = Integer.parseInt(cmd[1]); int experience = Integer.parseInt(cmd[2]); if (p.rights >= 2) { p.appendExperience(experience, level); return; } if (p.wildernessZone(p.absX, p.absY)) { p.getActionSender().sendMessage(p, "You cannot change levels while inside of the wilderness."); return; } for (int e : p.equipment) { if (e != -1) { p.getActionSender().sendMessage(p, "You cannot be wearing any armour while changing stats."); return; } } if (cmd[2].contains("-")) { return; } if (p.donator >= 0) { if (!(level == 0 || level == 1 || level == 2 || level == 4 || level == 5 || level == 6)); p.getActionSender().sendMessage(p, "Only Donators' can level non-combat levels using the 'lvl' command!"); p.getActionSender().sendMessage(p, "They get 10M extra spending experiance for this, buy your Donator status today!"); return; } if (experience > p.spendingExperience) { experience = p.spendingExperience; } int HPExperience = (int)Math.round((experience / 798) * 266); boolean oldEXPSetting = p.getExperience; p.getExperience = true; p.appendExperience(experience, level); p.appendExperience(HPExperience, 3); p.getExperience = oldEXPSetting; p.getActionSender().sendMessage(p, "You have just spent "+experience+"."); p.spendingExperience -= experience; p.getActionSender().sendMessage(p, "You have "+p.spendingExperience+" spending experience remaining."); }
Thanks for reading, Quik answer could be awesome!
bump
Don't bump threads its aginst rules...
anyway, explain your problem, what is it that you need? Are there errors, or can normal players can do the command?
sorry for no explanation here it comes:
No errors, however it makes donators and normal players cant lvl combat or non-combat skills, and this is supossed to make that donators can set both, and that normal players only can set combat skills, and that normal players also cant set non-combat skills (thieving wc, mining etc.)
Code:if (cmd[0].equals("lvl")) { int level = Integer.parseInt(cmd[1]); int experience = Integer.parseInt(cmd[2]); if (p.rights >= 2) { p.appendExperience(experience, level); return; } if (p.wildernessZone(p.absX, p.absY)) { p.getActionSender().sendMessage(p, "You cannot change levels while inside of the wilderness."); return; } for (int e : p.equipment) { if (e != -1) { p.getActionSender().sendMessage(p, "You cannot be wearing any armour while changing stats."); return; } } if (cmd[2].contains("-")) { return; } if (p.donator >= 0) { if (p.donator == 0 && !(level == 0 || level == 1 || level == 2 || level == 4 || level == 5 || level == 6)) { p.getActionSender().sendMessage(p, "Only Donators' can level non-combat levels using the 'lvl' command!"); p.getActionSender().sendMessage(p, "They get 10M extra spending experiance for this, buy your Donator status today!"); return; } if (experience > p.spendingExperience) { experience = p.spendingExperience; } int HPExperience = (int)Math.round((experience / 798) * 266); boolean oldEXPSetting = p.getExperience; p.getExperience = true; p.appendExperience(experience, level); p.appendExperience(HPExperience, 3); p.getExperience = oldEXPSetting; p.getActionSender().sendMessage(p, "You have just spent "+experience+"."); p.spendingExperience -= experience; p.getActionSender().sendMessage(p, "You have "+p.spendingExperience+" spending experience remaining."); } }
I r no pro at this but I'm pretty sure you can't have two "if" statements next to each other.
if (p.donator >= 0) {
if (!(level == 0 || level == 1 || level == 2 || level == 4 || level == 5 || level == 6));
p.getActionSender().sendMessage(p, "Only Donators' can level non-combat levels using the 'lvl' command!");
p.getActionSender().sendMessage(p, "They get 10M extra spending experiance for this, buy your Donator status today!");
return;
}
it doesnt give errors.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |