Thread: i need help with ::yell

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 i need help with ::yell 
    Registered Member
    Join Date
    Jun 2012
    Posts
    117
    Thanks given
    0
    Thanks received
    4
    Rep Power
    14
    so atm im trying to get players to able to use ::yell heres the code

    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    c2.getItems().deleteItem(4045, 9999);
    if (Connection.isMuted(c))
    return;
    if (c.Jail == true){
    c.sendMessage("You can't yell whilst in jail!");
    return;
    }
    if (c.isDonator == 1 && (c.playerRights < 0 || c.playerRights > 3)){
    c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 1){
    c2.sendMessage("<shad=123456>[Head Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 2){
    c2.sendMessage("<shad=65535>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerName.equalsIgnoreCase("Ali")){
    c2.sendMessage("<shad=15695415>[Beast Coder]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 3){
    c2.sendMessage("<shad=255>[Co-Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 5){
    c2.sendMessage("<shad=6081134>[Super Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 0 && c.isDonator == 0) {
    c.sendMessage("<shad=6081134><img=0>You must be a Donator to use ::Yell! Type :onate for more information.<img=0></col>");

    }
    }
    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    Code:
    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    c2.getItems().deleteItem(4045, 9999);
    if (Connection.isMuted(c))
    return;
    if (c.Jail == true){
    c.sendMessage("You can't yell whilst in jail!");
    return;
    }
    if (c.isDonator == 1 && (c.playerRights < 0 || c.playerRights > 3)){
    c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 1){
    c2.sendMessage("<shad=123456>[Head Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 2){
    c2.sendMessage("<shad=65535>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerName.equalsIgnoreCase("Ali")){
    c2.sendMessage("<shad=15695415>[Beast Coder]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 3){
    c2.sendMessage("<shad=255>[Co-Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 5){
    c2.sendMessage("<shad=6081134>[Super Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 0) {
    c.sendMessage("[Player]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    
    }
    }
    }
    }
    There you go post feedback


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2012
    Posts
    117
    Thanks given
    0
    Thanks received
    4
    Rep Power
    14
    Quote Originally Posted by Freezia View Post
    Code:
    if (playerCommand.startsWith("yell")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    c2.getItems().deleteItem(4045, 9999);
    if (Connection.isMuted(c))
    return;
    if (c.Jail == true){
    c.sendMessage("You can't yell whilst in jail!");
    return;
    }
    if (c.isDonator == 1 && (c.playerRights < 0 || c.playerRights > 3)){
    c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 1){
    c2.sendMessage("<shad=123456>[Head Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 2){
    c2.sendMessage("<shad=65535>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerName.equalsIgnoreCase("Ali")){
    c2.sendMessage("<shad=15695415>[Beast Coder]</col><img=5>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 3){
    c2.sendMessage("<shad=255>[Co-Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 5){
    c2.sendMessage("<shad=6081134>[Super Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    }else if (c.playerRights == 0) {
    c.sendMessage("[Player]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    
    }
    }
    }
    }
    There you go post feedback
    i gett a erorr
    if (playerCommand.startsWith("yell")) [right here] {
    Reply With Quote  
     

  4. #4  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    HUH? Just post the error please


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    May 2009
    Posts
    1,440
    Thanks given
    655
    Thanks received
    530
    Rep Power
    366
    Ugh are people still making shit code like this? Freezia, l2 conventions.

    Replace your yell command with this:
    Code:
    if (playerCommand.startsWith("yell")) {
    	for (int j = 0; j < Server.playerHandler.players.length; j++) {
    		if (Server.playerHandler.players[j] == null)
    			continue;
    		Client c2 = (Client)Server.playerHandler.players[j];
    		c2.getItems().deleteItem(4045, 9999);
    		if (Connection.isMuted(c))
    			return;
    		if (c.Jail == true){
    			c.sendMessage("You can't yell whilst in jail!");
    			return;
    		}
    		c2.sendMessage(c.getRank() + Misc.optimizeText(c.playerName) +": "+ Misc.optimizeText(playerCommand.substring(5)) +"");
    	}
    }
    And add this method to the Player class (Player.java for teh newbs)
    Code:
    public static String getRank() {
    	if(playerName.equals("Ali"))
    		return "<shad=15695415>[Beast Coder]</col><img=5>";
    	switch(playerRights) {
    		case 0:
    			if(c.isDonator == 1)
    				return "<shad=6081134>[Donator]</col><img=0>";
    			return "[Player]";
    		case 1:
    			return "<shad=123456>[Head Mod]</col><img=1>";
    		case 2:
    			return "<shad=65535>[Admin]</col><img=2>";
    		case 3:
    			return "<shad=255>[Co-Owner]</col><img=2>";
    		case 5:
    			return "<shad=6081134>[Super Donator]</col><img=0>;
    	}
    }
    Retired from RSPS development 2008-2018
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jun 2012
    Posts
    117
    Thanks given
    0
    Thanks received
    4
    Rep Power
    14
    Quote Originally Posted by Freezia View Post
    HUH? Just post the error please
    theirs no error
    but when im on server people are telling me they dont see my yell
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    May 2009
    Posts
    1,440
    Thanks given
    655
    Thanks received
    530
    Rep Power
    366
    Quote Originally Posted by monteros View Post
    theirs no error
    but when im on server people are telling me they dont see my yell
    Use the version that I provided, his version is complete shit and should not be in the help section.
    He put c.sendMessage when it should had been c2.sendMessage
    Retired from RSPS development 2008-2018
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jun 2012
    Posts
    117
    Thanks given
    0
    Thanks received
    4
    Rep Power
    14
    Quote Originally Posted by Dashboard View Post
    Ugh are people still making shit code like this? Freezia, l2 conventions.

    Replace your yell command with this:
    Code:
    if (playerCommand.startsWith("yell")) {
    	for (int j = 0; j < Server.playerHandler.players.length; j++) {
    		if (Server.playerHandler.players[j] == null)
    			continue;
    		Client c2 = (Client)Server.playerHandler.players[j];
    		c2.getItems().deleteItem(4045, 9999);
    		if (Connection.isMuted(c))
    			return;
    		if (c.Jail == true){
    			c.sendMessage("You can't yell whilst in jail!");
    			return;
    		}
    		c2.sendMessage(c2.getRank() + Misc.optimizeText(c.playerName) +": "+ Misc.optimizeText(playerCommand.substring(5)) +"");
    	}
    }
    And add this method to the Player class (Player.java for teh newbs)
    Code:
    public static String getRank() {
    	if(playerName.equals("Ali"))
    		return "<shad=15695415>[Beast Coder]</col><img=5>";
    	switch(playerRights) {
    		case 0:
    			if(c.isDonator == 1)
    				return "<shad=6081134>[Donator]</col><img=0>";
    			return "[Player]";
    		case 1:
    			return "<shad=123456>[Head Mod]</col><img=1>";
    		case 2:
    			return "<shad=65535>[Admin]</col><img=2>";
    		case 3:
    			return "<shad=255>[Co-Owner]</col><img=2>";
    		case 5:
    			return "<shad=6081134>[Super Donator]</col><img=0>;
    	}
    }
    reaplace the who entire thing or part of it?
    Reply With Quote  
     

  9. #9  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    Quote Originally Posted by Dashboard View Post
    Use the version that I provided, his version is complete shit and should not be in the help section.
    LOL, my version I'm sorry I'm doing what he asked and I fixed his code to incorporate players... please watch the way you talk mr copy and paste...


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    May 2009
    Posts
    1,440
    Thanks given
    655
    Thanks received
    530
    Rep Power
    366
    Quote Originally Posted by monteros View Post
    reaplace the who entire thing or part of it?
    Replace the entire command. Also I updated my code a minute back.
    Retired from RSPS development 2008-2018
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 50
    Last Post: 10-07-2015, 04:22 AM
  2. Replies: 11
    Last Post: 12-23-2011, 02:10 AM
  3. [PI] Customizable Yell Tags > Better Yell System
    By I try too hard in forum Help
    Replies: 6
    Last Post: 08-04-2011, 03:59 PM
  4. ::yell [delta] (with yell,ranks etc)
    By Coder Alex in forum Tutorials
    Replies: 9
    Last Post: 09-04-2009, 04:56 AM
  5. very easy yell timer can yell once in 5 secs
    By lord jahva in forum Tutorials
    Replies: 13
    Last Post: 07-06-2008, 10:57 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •