Nathan'
June 18th, 2010, 04:25
OK i'm not going to waste people's time, this is for the new coders who maybe are trying to be creative with their server.
Guide One - Adding interfaces to different aspects of your server.
Click Here For Preview (Only the registered members can see the link.)
Purpose of this tutorial - The main intention of this tutorial is to teach people how to make interfaces show when commands are executed, or when an object is clicked. People will be able to expand on this tutorial and create things such as items on death interface. Soul wars/Clan wars
Files Modified - ActionButtons.java, Commands.java
Step One - You need to find out the id of the interface - Only the registered members can see the link. (most interface ids)
Step Two - Open up net/com/codeusa/net/packethandler/Commands.java and search for -
"home"
Now just above that add -
if (cmd[0].equals("Your Command")) {
p.getActionSender().showInterface(p, What Ever Interface You Wish);
}
p.getActionSender().showInterface - When the command is executed the interface is shown.
Step Two - Now we need to make buttons work.
Open net/com/codeusa/net/packethandler/ActionButtons.java and search for -
case 277:
Now Just Above There Add
case 677:
if (buttonId == 17) {//procede
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
}
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
}
p.teleportTo(xxxx, yyyy, y, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
p.getActionSender().removeShownInterface(p);
}
Now for explaining the code -
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
} If the player is in combat in bounty hunter they cannot teleport by using the command.
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
} - If the player is either in combat/jailed they cannot teleport
p.teleportTo(xxxx, yyyy, y, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
p.getActionSender().removeShownInterface(p); Teleports the player to the designated position whilst removing the interface form the screen
Now we need to add the decline button - Just below the last bracket of the of the first part of case 677 add
if (buttonId == 18) {//Decline
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
}
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
}
p.getActionSender().removeShownInterface(p);
}
The code is exactly the same except it doesn't teleport the player.
Save and compile and post any errors here.
Please don't flame me, im kinda new myself and I thought this would be helpful.
Guide One - Adding interfaces to different aspects of your server.
Click Here For Preview (Only the registered members can see the link.)
Purpose of this tutorial - The main intention of this tutorial is to teach people how to make interfaces show when commands are executed, or when an object is clicked. People will be able to expand on this tutorial and create things such as items on death interface. Soul wars/Clan wars
Files Modified - ActionButtons.java, Commands.java
Step One - You need to find out the id of the interface - Only the registered members can see the link. (most interface ids)
Step Two - Open up net/com/codeusa/net/packethandler/Commands.java and search for -
"home"
Now just above that add -
if (cmd[0].equals("Your Command")) {
p.getActionSender().showInterface(p, What Ever Interface You Wish);
}
p.getActionSender().showInterface - When the command is executed the interface is shown.
Step Two - Now we need to make buttons work.
Open net/com/codeusa/net/packethandler/ActionButtons.java and search for -
case 277:
Now Just Above There Add
case 677:
if (buttonId == 17) {//procede
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
}
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
}
p.teleportTo(xxxx, yyyy, y, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
p.getActionSender().removeShownInterface(p);
}
Now for explaining the code -
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
} If the player is in combat in bounty hunter they cannot teleport by using the command.
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
} - If the player is either in combat/jailed they cannot teleport
p.teleportTo(xxxx, yyyy, y, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
p.getActionSender().removeShownInterface(p); Teleports the player to the designated position whilst removing the interface form the screen
Now we need to add the decline button - Just below the last bracket of the of the first part of case 677 add
if (buttonId == 18) {//Decline
if(p.InBounty == 1) {
p.getActionSender().sendMessage(p, "You cannot teleport out of Bounty Hunter");
return;
}
if (p.attackedBy != null) {
p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
return;
}
if (p.jailed > 0) {
p.getActionSender().sendMessage(p, "You are jailed!");
return;
}
p.getActionSender().removeShownInterface(p);
}
The code is exactly the same except it doesn't teleport the player.
Save and compile and post any errors here.
Please don't flame me, im kinda new myself and I thought this would be helpful.