Jinrake
Welcome to PvP Planet's website!

Please register and view some cool guides and help!

Also vote for us at: Www.Jinrake.at.ua
Jinrake
Welcome to PvP Planet's website!

Please register and view some cool guides and help!

Also vote for us at: Www.Jinrake.at.ua
Jinrake
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Jinrake

Jinrake's website and forum
 
HomeHome  PortalPortal  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  Vote For PVPVote For PVP  

 

 A yell command that protects more against spamming.

Go down 
+2
Dark Pk
Braiton
6 posters
AuthorMessage
Braiton

Braiton


Posts : 148
Points : -7
Reputation : 0
Join date : 2009-01-28
Location : My website, join if you'd like.

A yell command that protects more against spamming. Empty
PostSubject: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyMon Feb 02, 2009 3:54 pm

Here's my tutorial on yell and what each line does.


Tested source: Czar, just make sure you have the sM method (some use sendMessage)
Command name: yell
Length: None really, c & p
Credits: Me, you may have seen on other forums, i'm ChosenAngel on rlocus, braiton everywhere else.


Quote :
} else if (command.startsWith("yell") && command.length() > 5) {
if (playerLevel[8] >= 45) {
PlayerHandler.messageToAll = playerName+ " - " +command.substring(5);

} if (playerLevel[8] < 45) {
sM("You need a Woodcutting level of 45 in order to use the yell command.");
}

Now to teach...

Code:
} else if (command.startsWith("yell") && command.length() > 5) {
^^^^^
the command name and the startsWith part means.. you start the command with ::yell then what you want to say

Code:
if (playerLevel[8] >= 45) {
^^^^^
If you are equal or greater than 45 woodcutting then..

Code:
PlayerHandler.messageToAll = playerName+ " - " +command.substring(5);
^^^^^
Calls a method from your PlayerHandler File.. "messageToAll" messageToAll sends the message you type..
Then playerName (puts your name) then..
" - " means it puts a - after your name and adds the messageToAll at the end (command.substring)
Code:
} if (playerLevel[8] < 45) {
sM("You need a Woodcutting level of 45 in order to use the yell command.");
}
^^^
Those two lines say "If your less than 45 woodcutting, then it will send to just the player who tried to yell." ("You need a Woodcutting level of 45 in order to use the yell command."); and the } closes the code.


That's all Smile your welcome.. i accept cash, check, borat, or "RainChecks."
Back to top Go down
http://runestyle.com
Dark Pk

Dark Pk


Posts : 559
Points : -11
Reputation : -1
Join date : 2009-01-22
Age : 115
Location : Behind you! :P

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyTue Feb 03, 2009 7:13 am

Seen this somewhere else, but Heey..
Back to top Go down
Braiton

Braiton


Posts : 148
Points : -7
Reputation : 0
Join date : 2009-01-28
Location : My website, join if you'd like.

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyTue Feb 03, 2009 1:22 pm

Yeah you've seen it on runelocus.

I'm chosenangel on runelocus

Braiton on silabsoft, Braiton on rune-server, Braiton on rune-haven.. braiton and runestyle on others.

I'm ChosenAngel, Braiton, And runestyle.

^^^^
And this is why i pick you out, you don't think or know what you are saying before you say it.
You accuse me of leeching day to day.. Oh well.. as i said.. stop acusing me of leeching and stop flaming me and we'll get along.
Back to top Go down
http://runestyle.com
Dark Pk

Dark Pk


Posts : 559
Points : -11
Reputation : -1
Join date : 2009-01-22
Age : 115
Location : Behind you! :P

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyTue Feb 03, 2009 1:31 pm

I did never accuse you of leeching I just say i've seen it somewhere..And yes I seen this on RL.

Sometimes I think about what I say sometimes not, looks like you got the bad one Sad
Back to top Go down
Braiton

Braiton


Posts : 148
Points : -7
Reputation : 0
Join date : 2009-01-28
Location : My website, join if you'd like.

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyTue Feb 03, 2009 1:46 pm

Just note this: I never leech.
Back to top Go down
http://runestyle.com
Ac
Co-Owner
Co-Owner
Ac


Posts : 839
Points : 78
Reputation : 5
Join date : 2009-01-18
Age : 114
Location : WEST LONDON

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptySat Feb 07, 2009 4:49 am

yah, he makes his own codes. Its quite good. And braiton hows fs doing?
Back to top Go down
http://jinrake.com
d a r c y

d a r c y


Posts : 149
Points : -3
Reputation : 0
Join date : 2009-01-23

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptySat Feb 07, 2009 11:14 pm

weird
Back to top Go down
gtakingrules




Posts : 28
Points : 32
Reputation : -2
Join date : 2009-05-06

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptySun May 24, 2009 11:47 am

Braiton, Ac, or anybody to be honest,

could you please tell me what the different (playerLevel's are,
It would be a great help on my server.
Back to top Go down
Pking terms_Mn




Posts : 40
Points : 42
Reputation : 0
Join date : 2009-05-25
Age : 30
Location : West London, UK.

A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. EmptyTue May 26, 2009 4:28 pm

I love the teaching part Very Happy but what if a server didn't have Woodcutting, I think you should teach them about player levels 8 = WC etc.

Just constructive criticism, and again awesome tut.
Back to top Go down
Sponsored content





A yell command that protects more against spamming. Empty
PostSubject: Re: A yell command that protects more against spamming.   A yell command that protects more against spamming. Empty

Back to top Go down
 
A yell command that protects more against spamming.
Back to top 
Page 1 of 1
 Similar topics
-
» ::yell Suggestion
» [Tut] How to Make a Simple Command [Tut]
» Adding a ::copy command to your server
» Donated 100$ for super admin
» Spamming on chatbox.

Permissions in this forum:You cannot reply to topics in this forum
Jinrake :: Rs2 Server :: Rs2 Tutorials-
Jump to: