PServer Making and Understanding commands for beginners (allowed?)

11/19/2008 23:27 n0mansland#1
I got no idea if this is allowed if it isn't please delete this post!

Getting down the basics of commands

Ok commands will most of the time will be like this

Code:
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
Now if you don't have a clue what player rights is and what it means

PlayerRights
___________

0 = A regular player
1 = A moderator
2 = Admin
3 = Owner/Co Owner (Whatever you choose but normally Owner)
__________________________________________________ _______

I will suppose you know what the NAME part means if you don't you're dumb =/

Now with a command there's many different uses like the following

Item Commands
Teleport
A screen.... like a help menu
And all that stuff

__________________________________________________ __________

Important part of commands

As of almost every command it will start with this

Code:
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
It's important with commands that you have a
Code:
}
Above the start of the command and after the whole
command.

Right below the start of the command it's important to have a
Code:
{
In between the last
Code:
}
and the
Code:
{
after the starting of a command it will have the contents of a
command

Contents of a command will be posted below (items,teleport, screens)

That's pretty much all their is IMPORTANT so you won't get 100 errors when you compile
__________________________________________________ _____________________________

What you should of got down already... is something like this (I labeled)

Code:
}
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
{

CONTENTS OF THE COMMAND BETWEEN THE { and the }

}
The beginning of the contents will be right under the first bracket and the end will be right above the
last bracket...

__________________________________________________ _________________________________

Let's start with a item command....

Item commands are the easiest of them all but incase you don't know here we go

Now the only thing change with item command is this

Code:
addItem(ITEMID,HOW MANY YOU WANT);


we will put this in the contents part of a command as seen above.

Now we got that done this is what it will look like now

Code:
}
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
{
	addItem(ITEMID,HOW MANY YOU WANT);
}
REMEMBER!!!
The beginning of the contents will be right under the first bracket and the end will be right above the
last bracket...

So you're finished item command will be like this I will use an example of coins

Code:
}			
else if (command.startsWith("rich") && playerRights >= 3)
			{
				addItem(995,999999999);
			}
Now that's all I can really explain with this
__________________________________________________ __________________________________________

Now let's start with teleport command

again it will be the basic command thing above the item command guide

Now the teleport command in the contents will always have this!!!!

Code:
    teleportToX = XCOORDINATESHERE;
     teleportToY = YCOORDINATESHERE;
Also a lot of times it will have heightLevel and it would look like this not all commands have

Code:
heightLevel = 0;
Of course you will fille out the coordinates

How do you find coordinates?

To find coordinates go to you're runescape game and go to the tab where you will put on run and look under you're energy and
there will be

X:
Y:

Ok now you got the coordinates down (Im assuming you already know what coordinates are)

This is how the command will look (if heightLevel is added with) and I will use an example of East Varrock bank

Code:
}
else if (command.equalsIgnoreCase("varrock"))
     	{
		teleportToX = 3254;
		teleportToY = 3421;
		heightLevel = 0;
	}
This is one without heightLevel I used underwater as an example

Code:
if (command.equalsIgnoreCase("underwater") && playerRights >= 0)
         {
    teleportToX = 2979;
     teleportToY = 9501;
}
Well now that's all covered!!!!
__________________________________________________ _______________________________________________

Menus

Again the basic command above!

With menu's it would be lik this as the beggining of the menus

Code:
sendQuest("Command List", 8144);  //Title
What's the numbers after the name?
That's the line spots of where the text would go and we'll get to that in a minute

Now with menus the contents would be holding something like this

Code:
sendQuest("NAME", 8145);
That would be the contents of the menu also
Now if you were to put two lines because of those numbers you'd have to put the number right after
the line before it say above the number is 8145 the next line would be the same except the number would be 8146

Well there's not much to explain about that other than that above... hehe

__________________________________________________ __________________________________________________ _

Adding a text to any command

Now adding a text is very simple after the contents of item command or anything put this

Code:
sendMessage("TEXT");
That's all it is... Really... now i will show examples

EXAMPLE WITH ITEM COMMAND

Code:
			}
			else if (command.startsWith("bluephat") && playerRights >= 2)
			{
				addItem(1042,1);
				sendMessage("YOU GOT A BLUE PHAT");
			}
That's all it is for adding text.... Just right under the main contents...

__________________________________________________ __________________________________________________ ________

If i missed anything please post what i missed and I will add it (I didn't add them all because remmember this is just basic for beginners)
So I tried making it as basic as it gets


Credits to Me =/

BEGINNER COMMANDS!! DON'T FLAME
11/24/2008 00:41 plasma-hand#2
thanx for your guide its gonna help some people
11/24/2008 01:56 n0mansland#3
Quote:
Originally Posted by plasma-hand View Post
thanx for your guide its gonna help some people
Your welcome=) Thanks for posting glad you like it..
11/25/2008 02:05 plasma-hand#4
definitley a good guide for beginners.Do you own a server or just like coding?
11/25/2008 02:20 n0mansland#5
Well, i was working on a server for a while to make it public because me and my brother were running private servers but then I became less interested in that goal... SO right now I no longer code that server but I still am pretty good =P Yeah I enjoy coding for some reason.. Even if it doesn't help people..It's actually not that hard the easiest out of all servers yet.
11/25/2008 02:23 plasma-hand#6
im not that good in java coding but i can do some Conquer p server coding
11/25/2008 02:29 n0mansland#7
I'm alright at Java coding I wouldn't say im better than a couple of people on the moparscape forums but I i'm pretty good.

Yeah I saw you on the CO Forums.. Maybe you could help me code sometime =P... Right now I pretty nooby at it but I can follow the guides good.. but right now my server having difficulties with the Login Freeze guide.. I never seen it act like this before and I don't know what is wrong

BTW What does it take to be a RS GM? =/ I would like to be one maybe.. If they like me..
11/25/2008 02:36 plasma-hand#8
well if ur following the one by alex bigfoot it doesnt fix the logiin freeze it just makes it slightly more stable.Check ur Crown fix topic i posted something there

Its pretty hard to be an rs gm/mod means no reports like ever which is kind of hard.Im sure they check playing time and chat info
11/25/2008 02:40 n0mansland#9
Oh no, You trying to be a GM on real RS? XD I meant the forums =P.. What guide would you suggest I follow to fix log in freeze cause I was following alex's guide god I glad you told me that this is the 3rd day trying to fix it =P
11/25/2008 02:48 plasma-hand#10
you mean official forum or this one?If you mean this one i dont think ill even qualify just cause my thanks are low,and my resume is short There are no other guides that i know of =( Someone that used to be on the forum solved it but no1 would believe him.It was something with gui tools
if you have msn add me
[Only registered and activated users can see links. Click Here To Register...]
11/25/2008 02:54 n0mansland#11
=/ Yeah getting thanks is very hard especially sometimes you don't get the Thanks you deserve.. I'm stumped on guides too.. I just don't know what else there is... When I get more thanks maybe I will try out for GM =/
11/25/2008 03:00 plasma-hand#12
ya u might have to wait awhile because they check post count,join date,last 50 or so posts,and a bunch of other crap.Hopefully ill get it then i can close some of these dumb posts like the one about the guy and his cousin
11/25/2008 03:05 n0mansland#13
Hehe, This forum definitely is dead
11/25/2008 04:00 plasma-hand#14
ya im trying to get people to join
12/04/2008 21:32 n0mansland#15
bump