Thread: grrr error .-.

Results 1 to 5 of 5
  1. #1 grrr error .-. 
    GravityScape & SimpliCity Developer.

    RSWSkiller's Avatar
    Join Date
    Dec 2013
    Age
    27
    Posts
    754
    Thanks given
    184
    Thanks received
    68
    Rep Power
    172
    Heh, i need little bit help with one error :/

    So yeah , anyone know what i need to do ? or what's wrong with this line ? .-.

    Code:
    src\server\model\players\packets\Commands.java:1279: error: method sendMassMessa
    ge in class Client cannot be applied to given types;
                                                    c.sendMassMessage("<shad=1674547
    2>"+c.playerName+"</col> has jailed "+c2.playerName+"");
                                                     ^
      required: String,String
      found: String
      reason: actual and formal argument lists differ in length
    Reply With Quote  
     

  2. #2  
    Android/Java/Meteor/Node
    Orbyt's Avatar
    Join Date
    Oct 2013
    Posts
    335
    Thanks given
    25
    Thanks received
    21
    Rep Power
    11
    Quote Originally Posted by Skillerrr View Post
    Heh, i need little bit help with one error :/

    So yeah , anyone know what i need to do ? or what's wrong with this line ? .-.

    Code:
    src\server\model\players\packets\Commands.java:1279: error: method sendMassMessa
    ge in class Client cannot be applied to given types;
                                                    c.sendMassMessage("<shad=16745472>"+c.playerName+"</col> has jailed "+c2.playerName+"");
                                                     ^
      required: String,String
      found: String
      reason: actual and formal argument lists differ in length
    Well the error just says the sendMassMessage method required 2 Strings and your only sending 1.

    Post your sendMassMessage() to be sure. Also that message string looks really messed up....Why is there 2 quotation marks at the end..
    Reply With Quote  
     

  3. #3  
    GravityScape & SimpliCity Developer.

    RSWSkiller's Avatar
    Join Date
    Dec 2013
    Age
    27
    Posts
    754
    Thanks given
    184
    Thanks received
    68
    Rep Power
    172
    Quote Originally Posted by Charles View Post
    Well the error just says the sendMassMessage method required 2 Strings and your only sending 1.

    Post your sendMassMessage() to be sure. Also that message string looks really messed up....Why is there 2 quotation marks at the end..
    Ehh it's yell command, i like to add so other ppl can see who jailed who x.x

    here is my massmessage method :

    Code:
     public void sendMassMessage(String s, String s1) {
            for (int j = 0; j < PlayerHandler.players.length; j++) {
                if (PlayerHandler.players[j] != null) {
                        Client c2 = (Client)PlayerHandler.players[j];
                        c2.sendMessage("["+s+"]: "+s1);
                }
            }
        }
    There is my jail command .-.

    Code:
    if(playerCommand.startsWith("jail")) {
    			if(c.inWild()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
    			return;
    			}
                            if(c.InDung()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
    			return;
    			}          
                                        try {
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(PlayerHandler.players[i] != null) {
    					if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)PlayerHandler.players[i];
    					if(c2.InDung()) {
    						c.sendMessage("You cannot Jail/Unjail somone in Dung.");
    					}
                                            int randomjail = Misc.random(3);
    					if (randomjail == 1) {
    						c2.getPA().startTeleport(1928, 4999, 0, "modern");
    
    					}
    					if (randomjail == 2) {
    					c2.getPA().startTeleport(1928, 5000, 0, "modern");
    					
    					}
    					if (randomjail == 3) {
    					c2.getPA().startTeleport(1928, 5001, 0, "modern");
    					
    					}
    					if (randomjail == 0) {
    					c2.getPA().startTeleport(1928, 5002, 0, "modern");
    					
    					}
                                            c2.Jail = true;
    					c2.sendMessage("<shad=16711680>You have been jailed by "+c.playerName+"");
    					c.sendMessage("<shad=16711680>You have Jailed "+c2.playerName+".");
    					c.sendMassMessage("<shad=16745472>"+c.playerName+"</col> has jailed "+c2.playerName+"");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    Reply With Quote  
     

  4. #4  
    Android/Java/Meteor/Node
    Orbyt's Avatar
    Join Date
    Oct 2013
    Posts
    335
    Thanks given
    25
    Thanks received
    21
    Rep Power
    11
    Quote Originally Posted by Skillerrr View Post
    Ehh it's yell command, i like to add so other ppl can see who jailed who x.x

    here is my massmessage method :

    Code:
     public void sendMassMessage(String s, String s1) {
            for (int j = 0; j < PlayerHandler.players.length; j++) {
                if (PlayerHandler.players[j] != null) {
                        Client c2 = (Client)PlayerHandler.players[j];
                        c2.sendMessage("["+s+"]: "+s1);
                }
            }
        }
    There is my jail command .-.

    Code:
    if(playerCommand.startsWith("jail")) {
    			if(c.inWild()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
    			return;
    			}
                            if(c.InDung()) {
    			c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
    			return;
    			}          
                                        try {
    					String playerToBan = playerCommand.substring(5);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if(PlayerHandler.players[i] != null) {
    					if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    					Client c2 = (Client)PlayerHandler.players[i];
    					if(c2.InDung()) {
    						c.sendMessage("You cannot Jail/Unjail somone in Dung.");
    					}
                                            int randomjail = Misc.random(3);
    					if (randomjail == 1) {
    						c2.getPA().startTeleport(1928, 4999, 0, "modern");
    
    					}
    					if (randomjail == 2) {
    					c2.getPA().startTeleport(1928, 5000, 0, "modern");
    					
    					}
    					if (randomjail == 3) {
    					c2.getPA().startTeleport(1928, 5001, 0, "modern");
    					
    					}
    					if (randomjail == 0) {
    					c2.getPA().startTeleport(1928, 5002, 0, "modern");
    					
    					}
                                            c2.Jail = true;
    					c2.sendMessage("<shad=16711680>You have been jailed by "+c.playerName+"");
    					c.sendMessage("<shad=16711680>You have Jailed "+c2.playerName+".");
    					c.sendMassMessage("<shad=16745472>"+c.playerName+"</col> has jailed "+c2.playerName+"");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}

    Mmk try this:

    Code:
    c.sendMassMessage(c.playerName + " has jailed " + c2.playerName, "GG noob");
    I'm not sure why your sendMassMessage() has 2 String parameters, if you dont need the 2 you can just edit it and any uses of the method to only require 1 String.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    GravityScape & SimpliCity Developer.

    RSWSkiller's Avatar
    Join Date
    Dec 2013
    Age
    27
    Posts
    754
    Thanks given
    184
    Thanks received
    68
    Rep Power
    172
    Quote Originally Posted by Charles View Post
    Mmk try this:

    Code:
    c.sendMassMessage(c.playerName + " has jailed " + c2.playerName, "GG noob");
    I'm not sure why your sendMassMessage() has 2 String parameters, if you dont need the 2 you can just edit it and any uses of the method to only require 1 String.
    tnx
    Reply With Quote  
     


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. Same error over and over?!!
    By phantomphreak in forum Tutorials
    Replies: 4
    Last Post: 09-28-2007, 01:20 AM
  2. Basic Compile Errors
    By Daniel in forum Tutorials
    Replies: 4
    Last Post: 09-17-2007, 12:54 PM
  3. [HELP]Render Error
    By Big J in forum General
    Replies: 3
    Last Post: 07-30-2007, 01:01 AM
  4. Error. Please reboot me :)
    By Inside Sin in forum Showcase
    Replies: 4
    Last Post: 05-13-2007, 03:39 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
  •