how im change this command
i have this command:
PHP Code:
public static class TDrops extends CommandExecute {
@Override
public int execute(MapleClient c, String[] splitted) {
c.getPlayer().getMap().toggleDrops();
return 1;
}
}
i want to make it only toggle ID that i choose on the command like "!tdrops 4000000"
so i want to know how to do it? can someone change the command?
Re: how im change this command
How about change toggleDrops() first.
Re: how im change this command
Quote:
Originally Posted by
The Sharingan
How about change toggleDrops() first.
yes but i dont want only 1 item forever, i want to change it everytime i want.
like when you make item "!item X" so you always change the ID. same here
Re: how im change this command
Quote:
Originally Posted by
snow202
yes but i dont want only 1 item forever, i want to change it everytime i want.
like when you make item "!item X" so you always change the ID. same here
PHP Code:
public static class TDrops extends CommandExecute {
@Override
public int execute(MapleClient c, String[] splitted) {
int itemid;
try{
int itemid = Integer.parseInt(splitted[0]);
}catch{
c.getPlayer().dropMessage(5,"itemid is not numberic (or bigger than max int value?).");
return;
}
if(itemid != null) {
c.getPlayer().getMap().toggleDrops(itemid);
} else {
c.getPlayer().getMap().toggleDrops();
}
return 1;
}
}
Didn't test and I do not intend to. Wrote it here, so it's kinda messy, but it should work as long as you can define itemid in toggledrops.
Re: how im change this command
Quote:
Originally Posted by
The Sharingan
PHP Code:
public static class TDrops extends CommandExecute {
@Override
public int execute(MapleClient c, String[] splitted) {
int itemid;
try{
int itemid = Integer.parseInt(splitted[0]);
}catch{
c.getPlayer().dropMessage(5,"itemid is not numberic (or bigger than max int value?).");
return;
}
if(itemid != null) {
c.getPlayer().getMap().toggleDrops(itemid);
} else {
c.getPlayer().getMap().toggleDrops();
}
return 1;
}
}
Didn't test and I do not intend to. Wrote it here, so it's kinda messy, but it should work as long as you can define itemid in toggledrops.
and if i want to save it?(that the id will save for ever until i wont delete him), i need do something with MYSQL?
Re: how im change this command
Quote:
Originally Posted by
snow202
and if i want to save it?(that the id will save for ever until i wont delete him), i need do something with MYSQL?
Or properties, or an array. Whatever.