| A yell command that protects more against spamming. | |
|
|
Author | Message |
---|
Braiton
Posts : 148 Points : -7 Reputation : 0 Join date : 2009-01-28 Location : My website, join if you'd like.
| Subject: A yell command that protects more against spamming. Mon 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 your welcome.. i accept cash, check, borat, or "RainChecks." | |
|
| |
Dark Pk
Posts : 559 Points : -11 Reputation : -1 Join date : 2009-01-22 Age : 115 Location : Behind you! :P
| Subject: Re: A yell command that protects more against spamming. Tue Feb 03, 2009 7:13 am | |
| Seen this somewhere else, but Heey.. | |
|
| |
Braiton
Posts : 148 Points : -7 Reputation : 0 Join date : 2009-01-28 Location : My website, join if you'd like.
| Subject: Re: A yell command that protects more against spamming. Tue 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. | |
|
| |
Dark Pk
Posts : 559 Points : -11 Reputation : -1 Join date : 2009-01-22 Age : 115 Location : Behind you! :P
| Subject: Re: A yell command that protects more against spamming. Tue 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 | |
|
| |
Braiton
Posts : 148 Points : -7 Reputation : 0 Join date : 2009-01-28 Location : My website, join if you'd like.
| Subject: Re: A yell command that protects more against spamming. Tue Feb 03, 2009 1:46 pm | |
| Just note this: I never leech. | |
|
| |
Ac Co-Owner
Posts : 839 Points : 78 Reputation : 5 Join date : 2009-01-18 Age : 114 Location : WEST LONDON
| Subject: Re: A yell command that protects more against spamming. Sat Feb 07, 2009 4:49 am | |
| yah, he makes his own codes. Its quite good. And braiton hows fs doing? | |
|
| |
d a r c y
Posts : 149 Points : -3 Reputation : 0 Join date : 2009-01-23
| Subject: Re: A yell command that protects more against spamming. Sat Feb 07, 2009 11:14 pm | |
| | |
|
| |
gtakingrules
Posts : 28 Points : 32 Reputation : -2 Join date : 2009-05-06
| Subject: Re: A yell command that protects more against spamming. Sun 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. | |
|
| |
Pking terms_Mn
Posts : 40 Points : 42 Reputation : 0 Join date : 2009-05-25 Age : 30 Location : West London, UK.
| Subject: Re: A yell command that protects more against spamming. Tue May 26, 2009 4:28 pm | |
| I love the teaching part 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. | |
|
| |
Sponsored content
| Subject: Re: A yell command that protects more against spamming. | |
| |
|
| |
| A yell command that protects more against spamming. | |
|