Try this:
Post any errorsCode:if(command.startsWith("togglexp") && playerName.equalsIgnoreCase("steen")) { xp = doublexp ? xp * 2 : xp / 2; sm("Double XP: @dre@" + doublexp ? "On" : "Off" + "@bla@."; }
|
I made this:
if(command.startsWith("doublexp") && playerName.equalsIgnoreCase("Steen")) {
if(doublexp == true) {
xp = xp * 2;
sM("The bonus xp is ON!");
} else {
xp = xp;
}}
But he doesnt like it... In which variable do i need to change the "xp" because i receive an error about that.
(Got a boolean too.)
Try this:
Post any errorsCode:if(command.startsWith("togglexp") && playerName.equalsIgnoreCase("steen")) { xp = doublexp ? xp * 2 : xp / 2; sm("Double XP: @dre@" + doublexp ? "On" : "Off" + "@bla@."; }
Code:public static int expMultiplier = 1;Code:if(command.startsWith("togglexp") && playerName.equalsIgnoreCase("steen")) { expMultiplier = expMultiplier == 1 ? 2 : 1; sM("Double XP: @dre@" + (expMultiplier == 2 ? "On" : "Off") + "@bla@."; }
Use "SERVER_EXP_BONUS" in Config.java.
To make it into a command.. Maybe try..
if(command.startsWith("togglexp") && playerName.equalsIgnoreCase("steen")) {
SERVER_EXP_BONUS = 2;
sM("Experience has been multiplied!";
}
I dont know if this will work. Worth a try.
I dont got a config.
I got a config but thats not a document, its a map.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |