- Joined
- Feb 27, 2011
- Messages
- 11
- Reaction score
- 1
This tutorial shows you how to block commands ...
If I want to block @spinel in FM (910000000)
This is the original code.
So ... add
below
ok now below
add in
okay.. again, below
add in
So the finished code is...
This is like Ehab's but his code is
Ehab's one only allows @spinel in FM Map, but not in other maps.
So I tried to reverse his code and it worked! ..
Credits to Ehab 90%
Credits to Me for reversing his code
10%
please dont flame this is my first tutorial and Im new to coding.
And remember to compile or it won't work~
-
Questions I think people would ask
-
Q: Where do I put this code?
A: In Playercommands.java
Q: I got errors compiling (npc start)
A: If your source doesn't use
, you can try
If I want to block @spinel in FM (910000000)
PHP:
else if (splitted[0].equals("@spinel")) {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(c, 9000020);
}
So ... add
PHP:
if (player.getMapId() == 910000000){
PHP:
else if (splitted[0].equals("@spinel")) {
PHP:
if (player.getMapId() == 910000000){
PHP:
player.dropMessage("You cannot use this command in this map");
PHP:
player.dropMessage("You cannot use this command in this map");
PHP:
} else {
PHP:
else if (splitted[0].equals("@spinel")) {
if (player.getMapId() == 910000000){
player.dropMessage("You cannot use this command in this map");
} else {
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(c, 9000020);
}
PHP:
else if (splitted[0].equals("@spinel")) {
if (player.getMapId() == 910000000){
NPCScriptManager npc = NPCScriptManager.getInstance();
npc.start(c, 9000020);
} else {
mc.dropMessage("You cannot use this command in this map");
}
}
So I tried to reverse his code and it worked! ..
Credits to Ehab 90%
Credits to Me for reversing his code
please dont flame this is my first tutorial and Im new to coding.
And remember to compile or it won't work~
-
Questions I think people would ask
-
Q: Where do I put this code?
A: In Playercommands.java
Q: I got errors compiling (npc start)
A: If your source doesn't use
PHP:
npc.start(c, 9000020);
PHP:
NPCScriptManager.getInstance().start(c, 9000020, null, null);
Last edited:

