Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Config] [508] Some Stuff

Joined
May 17, 2007
Messages
2,474
Reaction score
681
Code:
/* 
-----------------------------------------------------------
 Class Sectum: Info Commands
 Description: Executes a command collecting info from user
-----------------------------------------------------------
*/

       if (cmd[0].equals("ip") && (p.rights >= 2)) {
               String person = playerCommand.substring((playerCommand.indexOf(" ") + 1));
               Player p2 = Engine.players[Engine.getIdFromName(person)];
        p.frames.sendMessage(p, "<img=2><col=990099> User IP is: " + Server.socketListener.getAddress(p2.socket.socket));
            }

       if (cmd[0].equals("userinfo") && (p.rights >= 2)) {
               String person = playerCommand.substring((playerCommand.indexOf(" ") + 1));
               Player p2 = Engine.players[Engine.getIdFromName(person)];
        p.frames.sendMessage(p, "<img=2><col=990099>      STATS FOR      [" + Misc.capitalize(p2.username) + "]");
        if (p2.memberCount > 0) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Donator?: Yes");}
        if (p2.memberCount < 1) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Donator?: No");}
        if (p2.rights > 1) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Staff?: Yes");}
        if (p2.rights < 1) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Staff?: No");}
        if (p2.muted > 1) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Muted?: Yes");}
        if (p2.muted < 0) {
        p.frames.sendMessage(p, "<img=2><col=FF6666>User is Muted?: No");}
        p.frames.sendMessage(p, "<img=2><col=FF6666>User's kill Count: " + p2.points);
        p.frames.sendMessage(p, "<img=2><col=FF6666>User's Coords: X = " + p2.absX + " Y = " + p2.absY);
            }

       if (cmd[0].equals("modreport") && (p.rights >= 1)) {
               String Report = playerCommand.substring(9); //changed this AJ, was at 6 which needs to be 9 - Arran
        p.frames.sendMessage(p, "<img=2><col=990099>MOD Report Submitted");
        Engine.fileManager.appendData("ModReports/" + Misc.capitalize(p.username) + ".txt", "[" + Misc.getDate() + "]: [" + playerCommand.substring(9) + "]");
            }




 
Last edited:
Joined
May 17, 2007
Messages
2,474
Reaction score
681
Re: helpful stuff

Code:
   		} 
		else if(cmd[0].equals("save")) // Saves character's file.
		{
       			if (Engine.wildernessArea(p.absX, p.absY)) {
            		p.frames.sendMessage(p, "<img=2><col=0066B3>For security Reasons, you cannot save in PK Areas. Please move to a save area.");
			return; }
                    	Engine.fileManager.saveCharacter(p);
			p.frames.sendMessage(p, "<img=2><col=990099>Account Saved Successfully");
 
Joined
May 17, 2007
Messages
2,474
Reaction score
681
Re: some stuff

forum made my conventions duck up lol

and these are helpful to econimy

::save will save manually
::ip gives ip info
::userinfo gives user info

::modreport makes a file which holds all mod reports (eg. ::modreport i banned ghost because hes a fag!!! )
 
right + down + X
Loyal Member
Joined
May 25, 2006
Messages
1,688
Reaction score
298
Re: some stuff

He did :'(

Didn't exactly know what the mod report command did, but thanks, I'll use it for sure when the server comes back up when discipline is needed
 
Skilled Illusionist
Joined
Sep 20, 2007
Messages
381
Reaction score
1
Re: some stuff

9/10 i guess piity good commands
 
Junior Spellweaver
Joined
Sep 22, 2007
Messages
138
Reaction score
2
Re: some stuff

How do you give yourself a higher rank like 2 or 3 or something?
 
ThuGie.NL - Webmaster
Joined
Apr 16, 2006
Messages
607
Reaction score
55
Hey shouldnt this be better ?

Code:
/* 
-----------------------------------------------------------
 Class Sectum: Info Commands
 Description: Executes a command collecting info from user
-----------------------------------------------------------
*/

	if (cmd[0].equals("ip") && (p.rights >= 2)) {
		String person = playerCommand.substring((playerCommand.indexOf(" ") + 1));
		Player p2 = Engine.players[Engine.getIdFromName(person)];
		p.frames.sendMessage(p, "<img=2><col=990099>User IP is: " + Server.socketListener.getAddress(p2.socket.socket));
	} else if (cmd[0].equals("userinfo") && (p.rights >= 2)) {
		String person = playerCommand.substring((playerCommand.indexOf(" ") + 1));
		Player p2 = Engine.players[Engine.getIdFromName(person)];
		p.frames.sendMessage(p, "<img=2><col=990099>      STATS FOR      [" + Misc.capitalize(p2.username) + "]");
		p.frames.sendMessage(p, "<img=2><col=FF6666>User is Donator?: " + ((p2.memberCount > 0)? "Yes" : "No"));
		p.frames.sendMessage(p, "<img=2><col=FF6666>User is Staff?: " + ((p2.rights > 0)? "Yes" : "No"));
		p.frames.sendMessage(p, "<img=2><col=FF6666>User is Muted?: " + ((p2.muted > 0)? "Yes" : "No"));
		p.frames.sendMessage(p, "<img=2><col=FF6666>User's kill Count: " + p2.points);
		p.frames.sendMessage(p, "<img=2><col=FF6666>User's Coords: X = " + p2.absX + " Y = " + p2.absY);
	} else if (cmd[0].equals("modreport") && (p.rights >= 1)) {
		String Report = playerCommand.substring(9); //changed this AJ, was at 6 which needs to be 9 - Arran
		p.frames.sendMessage(p, "<img=2><col=990099>MOD Report Submitted");
		Engine.fileManager.appendData("ModReports/" + Misc.capitalize(p.username) + ".txt", "[" + Misc.getDate() + "]: [" + playerCommand.substring(9) + "]");
	} else if(cmd[0].equals("save")) {
		if (Engine.wildernessArea(p.absX, p.absY)) {
			p.frames.sendMessage(p, "<img=2><col=0066B3>For security Reasons, you cannot save in PK Areas. Please move to a save area.");
			return;
		}
		Engine.fileManager.saveCharacter(p);
		p.frames.sendMessage(p, "<img=2><col=990099>Account Saved Successfully");
	}
Although this will get diffrent results.
As to
if (p2.rights > 1) {
if (p2.rights < 1) {
I'm pretty sure that if rights = 1 nothing will get send.
Checking higher or lower then 1 but not if its one.
So i asume it should be if (p2.rights > 0) {

And for muted
if (p2.muted > 1) {
if (p2.muted < 0) {
So if muted is lower then 0 so if its -1 or even lower your not muted,
But if its higher then 1 your muted so if its 2 or higher not when its 1 ?
Shouldnt it be like a boolean 1 = muted 0 = non-muted.

And as you can see i tried using "ternary operators",
But it is the first time i tried using them so not sure if its correct.
 
Newbie Spellweaver
Joined
Oct 20, 2008
Messages
17
Reaction score
0
For the get Player IP command, I got this when I compiled :

.\palidino76\rs2\io\packets\Commands.java:173: non-static method getIdFromName(java.lang.String) cannot be referenced from a static context
Player p2 = Engine.players[Engine.getIdFromName(person)];
^
1 error
Press any key to continue . . .

Any Help??
 
Newbie Spellweaver
Joined
Oct 20, 2008
Messages
17
Reaction score
0
For the get Player IP command, I got this when I compiled :

.\palidino76\rs2\io\packets\Commands.java:173: non-static method getIdFromName(java.lang.String) cannot be referenced from a static context
Player p2 = Engine.players[Engine.getIdFromName(person)];
^
1 error
Press any key to continue . . .

Any Help??
 
Back
Top