PDA

View Full Version : [562] Different login messages for different ranks



flavius
March 21st, 2011, 05:00
In this tut, I am showing you how to have your own custom login messages for Admins and mods.

This is for a Noszscape base, so if you do not have Noszscape, edit the code a little bit or place them in the right section.

This tut is most defiantly for noobs.

Editing : ActionSender.java
Difficulty: 1/10

Here we go,

First open ActionSender.java In Your server name >src>RS2hd>net>ActionSender.java

Then search (ctrl+F)

Welcome
Under this something like this should be there, if not just search "if(player.banned)"


if(player.banned) {
player.getActionSender().sendLogout();
return;
}
Under that add

if (player.getRights() == 1) {
player.graphics(453);
player.forceChat("Im Back!, Yes i'm a mod.");
sendMessage("<shad=0066FF>Your a Mod, "+player.getUsername()+", Help the players!");
sendMessage("<shad=0066F6>Forums at ...");
sendMessage("<shad=0066F6>Vote at ....");
sendMessage("<shad=0066F6>Please do not ask for admin in any way, Thanks");
sendMessage("<shad=ff0000>Also, Do NOT give players ITEMS!");
}
if (player.getRights() == 2) {
player.forceChat("I'm Back!");
player.graphics(1978);
sendMessage("<shad=0066FF>Your an admin, "+player.getUsername()+", watch over the mods, and Help the players!");
dMessage("<shad=0066F6>Help out on the Fourms and server.");
sendMessage("<shad=0066F6>Please direct Mods on what they are suposed to do.");
sendMessage("<shad=0066F6>Forums at .....");
sendMessage("<shad=0066F6>Vote at ......");
sendMessage("<shad=0066F6>Offical site at...");
sendMessage("<shad=ff0000>Please do not Give items out. To spawn Items type ::item (item ID) (amount)");
}

Then under


if(player.starter == 0) {
player.animate(8525);
player.graphics(1515);
player.starter = 1;
sendMessage("<shad=0066FF>Click the scroll for your starter items!");
sendMessage("<shad=0066F6>Forums at ...");
sendMessage("<shad=0066F6>Vote at ....");
player.getInventory().addItem(550, 1);


Replace " } else {" with


} else if (player.getRights() == 0) {
This code is so both mod/admin and player messages don't show up for mods or admins.

Hope it was easy enough, This is my first tut BTW.

If you would like to do one for Donators and your player Rights are 4 for donators, Just add

Another

[code] if (player.getRights() == 1) {
player.graphics(453);
player.forceChat("Im Back!, Yes i'm a mod.");
sendMessage("<shad=0066FF>Your a Mod, "+player.getUsername()+", Help the players!");
sendMessage("<shad=0066F6>Forums at ...");
sendMessage("<shad=0066F6>Vote at ....");
sendMessage("<shad=0066F6>Please do not ask for admin in any way, Thanks");
sendMessage("<shad=ff0000>Also, Do NOT give players ITEMS!");
}
And change the 1 in "if(player.getRights() == 1) to 4 and edit what the message says. :P


Some sources like Nosz have



" if (player.donator == #) {" instead of "if (player.getRights() ==#) {"

For the Donator rank.

Thanks for reading =P.

flavius
March 21st, 2011, 06:14
Please help? someone?

ymx boy
March 21st, 2011, 06:15
Man sorry but i can't tell u :( i suggest u leave it where it says to every1 becuz like umm the members gunna know it ain't talakin to them and the staff will tho :P

samuraiblood2
March 21st, 2011, 07:22
if (player.getRights < 1) {
if (player.starter == 0) {
player.animate(8525);
player.graphics(1515);
player.starter = 1;
sendMessage("<shad=0066FF>Click the scroll for your starter items!");
player.getInventory().addItem(550, 1);
} else {
player.animate(8525);
player.graphics(1515);
player.forceChat("Im Back!");
sendMessage("<shad=0066ff>Enjoy RomoScape <img=1>" + player.getUsername() + "<img=1>");
sendMessage("<shad=0066ff>Remember to VOTE daily, Blank!");
sendMessage("<shad=0066FF>please visit our forums at Blank!");
sendMessage("<shad=0066FF>Go to ::clanwars for pking.");
sendMessage("<shad=00ffff>NOTICE: An earth quake maybe happening here were I live");
sendMessage("<shad=00ffff>So if it happens This server will be down.");
}
} else {

// TODO: Load this from a configuration file.
// TODO: Arrays are far too awkward for this.
// XXX: Seperate new lines/messages with the newline (\n) character.
String[] msgs = {
/* Moderators */ "Welcome back moderator " + player.getUsername() + "...\nRemember not to ever give items out!",
/* Admins */ "Weclome back administrator " + player.getUsername() + "...\nRemember not to ever give items out!"
};

String[] tokens = msgs[player.getRights() - 1].split("\n");
for (int i = 0; i < tokens.length; i++) {
sendMessage(tokens[i]);
}
}Its not very elegant, but should work fine.

apache ah64
March 21st, 2011, 18:42
this sucks so hard evry noob that give 1 look can make this.

flavius
March 21st, 2011, 19:05
Fixed, Might as well make it a tut.

flavius
March 21st, 2011, 19:35
.... Thanks dude...

Plasma
April 17th, 2011, 16:44
Great tut :P, I gave you a internet for it lol ;)

flavius
April 17th, 2011, 19:48
Great tut :P, I gave you a internet for it lol ;)


lol, Thanks :P

Vesta Main
April 17th, 2011, 19:50
This is easy, nice guide for people who dont know :)

flavius
April 17th, 2011, 20:08
This is easy, nice guide for people who dont know :)

I know :P, I remembered of a 317 that had this and I just decided to make it for 562 too, very easy but worth it, because now everyone know what there job is P:

jefferson
April 18th, 2011, 20:59
This is like.. shit.. :/

2kbarrows
April 18th, 2011, 21:09
Please make this in Python, much better.

flavius
April 19th, 2011, 00:42
This is like.. shit.. :/
Troll again? GTFO of these forums... and wtf? I love how you think your a bad ass because you can call a beginner Shit.



Please make this in Python, much better.

Python? Explain please?

David
April 19th, 2011, 06:19
Python? Explain please?

Python is one of the programming languages?
It's used for the scripts in rs2hd: Data -> Scripts

flavius
April 20th, 2011, 02:40
Python is one of the programming languages?
It's used for the scripts in rs2hd: Data -> Scripts

Okay, Thanks.
Was wondering what type of code that was.