View Full Version : [562][RS2HD] Black mark system
scootersam
September 30th, 2010, 22:33
before we start dont flame me and ik this is very very very very very very very very very very very very very very very very very very very very easy! :L
ok so
goto src>com>rs2hd>packethandler>CommandPacketHandler.java
add these codes in
if if(cmd[0].equals("giveblackmark")) {
Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
if (other != null) {
other.blackmark += 1;
other.sm("You have been given a black mark, you now have: "+player.blackmark+", Be more carefull.");
player.sm("You have givven: "+other.getUsername()+" a black mark!");
}
} if(cmd[0].equals("takeblackmark")) {
Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
if (other != null) {
other.blackmark -= 1;
other.sm("You have had a black mark taken off you, you now have: "+player.blackmark+" blackmarks");
player.sm("You have taken a blackmark from: "+other.getUsername()+" !");
}
}
now go into src>com>rs2hd>net>actionsender.java
and search starter (press ctrl + f)
and add this
if(player.blackmark == 5) {
player.muted = true;
}
if(player.blackmark == 10) {
player.banned = 1;
player.getActionSender().sendLogout();
}
and now last declare this in player.java
src>com>rs2hd>model>player.java
scroll down a litle and add this
public int blackmark = 0;
and booom you have got bacl mark system!
and ik its easy
thanks
Emily
September 30th, 2010, 22:34
before we start dont flame me and ik this is very very very very very very very very very very very very very very very very very very very very easy! :L
ok so
goto src>com>rs2hd>packethandler>CommandPacketHandler.java
add these codes in
if(cmd[0].equals("giveblackmark")) {
Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
if (other != null) {
other.blackmark += 1;
other.sm("You have been given a black mark, you now have: "+player.blackmark+", Be more carefull.");
player.sm("You have givven: "+other.getUsername()+" a black mark!");
if(player.blackmark == 10){
if(other.blackmark == 10){
String ban = command.substring((command.indexOf(" ") + 1));
XStreamPlayerLoader.punish.writeTo(ban, "./data/text/bans");
player.getActionSender().sendMessage((new StringBuilder()).append("You gave him his last blacvk mark! ").append(ban).toString());
final Player p = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(ban));
p.banned = 1;
p.getActionSender().sendLogout();
}
}
}
}
if(cmd[0].equals("takeblackmark")) {
Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
if (other != null) {
other.blackmark -= 1;
other.sm("You have had a black mark taken off you, you now have: "+player.blackmark+" blackmarks");
player.sm("You have taken a blackmark from: "+other.getUsername()+" !");
}
}
and booom you have got bacl mark system!
and ik its easy
thanks
You forgot the part in action sender if there black marks is greater then 5 it mutes, and equal to 10 it bans..
scootersam
September 30th, 2010, 22:35
hmm good point ill do this in a min
Cart
September 30th, 2010, 22:44
You also mispelled careful.
and blackmarks XD.
scootersam
September 30th, 2010, 22:46
oh well xD
Kevin'
September 30th, 2010, 22:57
Good Job Sam.
scootersam
September 30th, 2010, 22:57
thanks kev simple shit tbh :L
Emily
September 30th, 2010, 23:00
Codes redundant, just put this in actionsender instead of making the if 5 and if 10 statements..
find the login method
public void sendLogin() {
if(player.blackmark == 5) {
player.muted = true;
}
if(player.blackmark == 10) {
player.banned = 1;
player.getActionSender().sendLogout();
}
scootersam
September 30th, 2010, 23:01
ahh shit yeah good point :L
Kevin'
September 30th, 2010, 23:24
Also Did you forget to show how to Declare it in player.java?
Niator
September 30th, 2010, 23:25
Simple, but nice...
battlezone
September 30th, 2010, 23:58
very simple but good realse for people that cant do it them selfs.
and kevin he didnt forget it he figured its comon sense
scootersam
October 1st, 2010, 15:42
lol i did forget it xD
Stacx
October 1st, 2010, 15:46
private transient int blackmark;
public int getBlackmarks() {
return blackmark;
}
public void setBlackmarks(int b) {
this.blackmark = b;
}
scootersam
October 1st, 2010, 15:47
idk what thats for but okay :L
Stacx
October 1st, 2010, 15:50
idk what thats for but okay :L
You should keep alot of junk variables such as this transient, you don't want huge player files.
Jon
October 1st, 2010, 15:57
You should keep alot of junk variables such as this transient, you don't want huge player files.
Why would blackmarks be a transient?, you don't want their marks to reset because they logged out >_<
Stacx
October 1st, 2010, 15:58
Why would blackmarks be a transient?, you don't want their marks to reset because they logged out >_<
And create two for something like this lmao?
Trey
October 1st, 2010, 21:03
You should keep alot of junk variables such as this transient, you don't want huge player files.
Why would you do that? You'd want to save something like blackmarks.
jordiee
July 29th, 2011, 17:45
How do you add it in the the quest tab or summe? so they know how much black marks they have.
own4g3
July 29th, 2011, 18:06
How do you add it in the the quest tab or summe? so they know how much black marks they have.
You bumped a 9 months old thread...
Anyways, InterfaceSwitches.java
David
July 29th, 2011, 18:11
You bumped a 9 months old thread...
Anyways, InterfaceSwitches.java
Or ActionSender
jordiee
July 31st, 2011, 14:34
Thanks guys but its not in either, and when i do it to try and mute and ban it dosent work ://
Also it says "you have been given a BlackMark, you now have 0 black marks."
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.