Jump to content
Sign in to follow this  
Danielxx

New Ranks In Depth

Recommended Posts

Hey guys,
I've Recently added this new rank to my server, so i thought id share it around, there are others out there but i'll show you a in depth guide to making a new Rank for your RSPS.

Firstly you need to Decide what kind of rank this will be, either a Staff rank, Server veterans, King donator rank, a Vip Rank for donators. for this Tutorial i have Chosen VIP Donator Rank, so once you have figured that out. simply open[B][COLOR="#000000"] player.java[/COLOR][/B]

Search for this piece of coding:
[CODE]private boolean donator;[/CODE]

Once you have found that simply underneath it add the following code:
[CODE]private boolean Vip;[/CODE]

once you have done that Search for the following piece of code:
[CODE]public boolean isExtremePermDonator() {
return extremeDonator;
}[/CODE]

simply under that add this piece of code:
[CODE]public boolean isVip() {
return Vip;
}

public void setVip(boolean Vip) {
this.Vip = Vip;
}[/CODE]

now to make your selected rank have a public chat icon search for the following code:
[CODE]public int getMessageIcon() {[/CODE]

and add to it - [CODE]isVip() ? 5[/CODE]
now basically to find out the icon you want for the selected rank type ingame ;;yell <img=1> - up to 13 find the one you like for the chosen rank. and place it were my (5) is

once you have done all of that open up [B][COLOR="#000000"]Commands.java[/COLOR][/B]
Here we are going to Create a command+ yells, and ;;players.

preferably in Admin commands section, add this piece of code:
[CODE]case "makevip":
name = "";
for (int i = 1; i < cmd.length; i++)
name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
target = World.getPlayerByDisplayName(name);
if (target == null)
return true;
target.getAppearence().setTitle(67879);
target.setVip(true);
target.getPackets().sendGameMessage(
"<shad=33CCCC>Thankyou for supporting our server, you've been promoted to V.I.P donator status by "
+ Utils.formatPlayerNameForDisplay(player
.getUsername()), true);
player.getPackets().sendGameMessage(
"You've Successfully given Vip Status to "
+ Utils.formatPlayerNameForDisplay(target
.getUsername()), true);
World.sendWorldMessage("<img=5><col=ff0000>News: "+target.getDisplayName()+"Has just been awarded V.I.P Donator!", false);
return true;[/CODE]

Now this is the command that i use on my server, it displays a world message that the player i have choosen will be awarded VIP rank, also sets them a title, to learn how to make a title. take a look at my [URL="http://www.runelocus.com/forums/showthread.php?91729-Custom-Titles-amp-Colours"]Custom Title Tutorial here[/URL]

To remove a a Vip Rank from a player add this command underneath:
[CODE]case "takevip":
name = "";
for (int i = 1; i < cmd.length; i++)
name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
target = World.getPlayerByDisplayName(name);
if (target == null)
return true;
target.getAppearence().setTitle(0);
target.setVip(false);
target.getPackets().sendGameMessage(
"<shad=33CCCC>You're Vip Donator Rank was taken by "
+ Utils.formatPlayerNameForDisplay(player
.getUsername()), true);
player.getPackets().sendGameMessage(
"You've Successfully taken Vip Status from "
+ Utils.formatPlayerNameForDisplay(target
.getUsername()), true);
World.sendWorldMessage("<img=1><col=ff0000>News: "+target.getDisplayName()+" has just lost their V.I.P Rank!", false);
return true;[/CODE]

What this command does, is simply removes the Rank from Selected player, and also Removes the title provided.

once you have done that Search [B][COLOR="#000000"]Players[/COLOR][/B], in [COLOR="#000000"][B]commands.java[/B]
[/COLOR]

add this piece of coding into your command ;;players
[CODE]if (p5.isVip()) {
titles = "[<img=5><col=33CCCC>V.I.P Donator</col></shad>]";
}[/CODE]

once you have done that search for the following code:
[CODE]public static void sendYell[/CODE] - should be close to row 2886,

add the following code underneath:
[CODE]else if (player.isVip() && player.getRights() == 0)
World.sendWorldMessage("[<img=5><col=33CCCC>V.I.P</col>] <img=5>"
+ player.getDisplayName() + ": <col=33CCCC>" + message
+ "</col>", false);[/CODE]
you can pick your own hex colours of course, so basically what we have done with this tutorial, you have created a new Rank, you have chosen and added your rank to ;;players + added icons for ingame chats, also added a yell, And created a nice command for the rank.

- Danielxx

Share this post


Link to post
Share on other sites
yea it's pretty basic stuff for some, but I've been asked multiple times "how to make a new rank" so here it is :), thanks

Share this post


Link to post
Share on other sites
Really good work, helping out the community and such and although it is basic doesn't mean it isn't helpful or useful, thanks a lot!

Share this post


Link to post
Share on other sites
[quote name='VertexPkRsps']Thank you for this, i've been looking everywhere[/QUOTE]

no worries glad i could help

Share this post


Link to post
Share on other sites
Sign in to follow this  

×