Jump to content
Dust R I P

[PI] Ban Hammer - banning without the need to type a username

Recommended Posts

Made this cause i was bored, should work fine. Tested on a PI. Should work on all winterloves i guess?

Difficulty:
Very easy

Requirements:
Cycle based eventmanager
A server

What you're adding:
[IMG]http://puu.sh/4DAOV.jpg[/img]

Add this in checkreqs (should be in combatassistant)

Above:
[CODE]if(!PlayerHandler.players[c.playerIndex].inWild()[/CODE]

Add:
[CODE]
if(c.playerEquipment[c.playerWeapon] == 7449) {
c.startAnimation(2067);
c.attackTimer = 10;
c.turnPlayerTo(PlayerHandler.players[c.playerIndex].absX, PlayerHandler.players[c.playerIndex].absY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
public void execute(CycleEventContainer container) {
if(c.attackTimer == 9) {
PlayerHandler.players[c.playerIndex].startAnimation(1950);
}
if(c.attackTimer == 4) {
Connection.addNameToBanList(PlayerHandler.players[c.playerIndex].playerName);
Connection.addNameToFile(PlayerHandler.players[c.playerIndex].playerName);
c.sendMessage("You have sucessfully banned " + PlayerHandler.players[c.playerIndex].playerName + ".");
PlayerHandler.players[c.playerIndex].disconnected = true;
c.getCombat().resetPlayerAttack();
container.stop();
}
}
public void stop() {
return;
}

}, 1);
return false;
}
[/CODE]

Close and save

Now go to your Client.java
Look for something like:

[CODE]getPA().sendFrame126("@[email protected]: " + wildLevel, 199);[/CODE]

and under the last bracket add:

[CODE] else if(playerEquipment[playerWeapon] == 7449) {
getPA().showOption(3, 0, "Ban", 2);
} [/CODE]

So it should look like something like this:

[CODE]
if(inWild()) {
int modY = absY > 6400 ? absY - 6400 : absY;
wildLevel = (((modY - 3520) / 8) + 8);
getPA().walkableInterface(197);
getPA().sendFrame126("@[email protected]: " + wildLevel, 199);
getPA().showOption(3, 0, "Attack", 1);
} else if(playerEquipment[playerWeapon] == 7449) {
getPA().showOption(3, 0, "Ban", 2);
}
[/CODE]

And you're done!

You can right click ban people when you're wearing the hammer ;)
BanHammer ID: 7449

Credits :
100% ThetaScape - Dust R I P

Share this post


Link to post
Share on other sites
lol seems fun. Nice job and I like the item sprite/image. Did you make it yourself or is it something from RuneScape?

Share this post


Link to post
Share on other sites
[quote name='StevenAbraham']lol seems fun. Nice job and I like the item sprite/image. Did you make it yourself or is it something from RuneScape?[/QUOTE]

[URL="http://runescape.wikia.com/wiki/Meat_tenderiser"]Meat tenderiser[/URL]

Share this post


Link to post
Share on other sites
[quote name='Cart'][URL="http://runescape.wikia.com/wiki/Meat_tenderiser"]Meat tenderiser[/URL][/QUOTE]

Before I clicked link, all that came to mind was... Well, you know. ;)

Share this post


Link to post
Share on other sites
[quote name='Night Night']Awkward if you miss click?[/QUOTE]
It only shows the option when you wear the hammer so don't wear the hammer when not necessary

Share this post


Link to post
Share on other sites

×