Thread: Server message when someone votes

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 Server message when someone votes 
    Donator

    Join Date
    Mar 2012
    Posts
    466
    Thanks given
    26
    Thanks received
    20
    Rep Power
    11
    This is what I get when I try to add it:
    Code:
    			if (cmd[0].equalsIgnoreCase("claim")) { 
    				   try { 
    				     VoteReward reward = MainLoader.hasVoted(player
    				       .getUsername().toLowerCase().replaceAll(" ", "_"));
    				     if (reward != null) {
    				     switch (reward.getReward()) { 
    				       case 0:
    				    	   player.getInventory().addItem(24155, 1);
    						   player.getInventory().addItem(2996, 1);
    				    	   break;
    				                            case 1:
    				                               
    				                                break;
    				       case 2:
    				     
    				        break;
    				                            //add more here
    				                            default:
    				                                player.getPackets().sendMessage(99, "Reward not found.", player);
    				                                break;
    				                        }
    				                        player.getPackets().sendMessage(99, "Thank you for voting.", player);
    				                    } else {
    				                        player.getPackets().sendMessage(99, "You have no items waiting for you.", player);
    				                    }
    				                } catch (Exception e){
    				                    player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
    									players.getPackets().sendGameMessage(
    								"<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.");
    										}
    				                    return true;
    				     }

    Reply With Quote  
     

  2. #2  
    guinea lord
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    18
    Posts
    1,456
    Thanks given
    239
    Thanks received
    503
    Rep Power
    56
    World.sendWorldMessage("");
    Reply With Quote  
     

  3. #3  
    Lost Redemption Owner & Founder
    Lost Redemption's Avatar
    Join Date
    Jan 2013
    Age
    17
    Posts
    852
    Thanks given
    194
    Thanks received
    53
    Rep Power
    15
    Code:
    			if (cmd[0].equalsIgnoreCase("claim")) { 
    				   try { 
    				     VoteReward reward = MainLoader.hasVoted(player
    				       .getUsername().toLowerCase().replaceAll(" ", "_"));
    				     if (reward != null) {
    				     switch (reward.getReward()) { 
    				       case 0:
    				    	   player.getInventory().addItem(24155, 1);
    						   player.getInventory().addItem(2996, 1);
    				    	   break;
    				                            case 1:
    				                               
    				                                break;
    				       case 2:
    				     
    				        break;
    				                            //add more here
    				                            default:
    				                                player.getPackets().sendMessage(99, "Reward not found.", player);
    				                                break;
    				                        }
    				                        player.getPackets().sendMessage(99, "Thank you for voting.", player);
    				                    } else {
    				                        player.getPackets().sendMessage(99, "You have no items waiting for you.", player);
    				                    }
    				                } catch (Exception e){
    				                    player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
    									player.getPackets().sendGameMessage(
    								"<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.");
    										}
    				                    return true;
    				     }
    Remove the "s" from "players"
    Please vouch for PortHosts! You get the most for your money with PortHosts!
    Reply With Quote  
     

  4. #4  
    Donator

    Join Date
    Mar 2012
    Posts
    466
    Thanks given
    26
    Thanks received
    20
    Rep Power
    11
    Quote Originally Posted by Lost Redemption View Post
    Code:
    			if (cmd[0].equalsIgnoreCase("claim")) { 
    				   try { 
    				     VoteReward reward = MainLoader.hasVoted(player
    				       .getUsername().toLowerCase().replaceAll(" ", "_"));
    				     if (reward != null) {
    				     switch (reward.getReward()) { 
    				       case 0:
    				    	   player.getInventory().addItem(24155, 1);
    						   player.getInventory().addItem(2996, 1);
    				    	   break;
    				                            case 1:
    				                               
    				                                break;
    				       case 2:
    				     
    				        break;
    				                            //add more here
    				                            default:
    				                                player.getPackets().sendMessage(99, "Reward not found.", player);
    				                                break;
    				                        }
    				                        player.getPackets().sendMessage(99, "Thank you for voting.", player);
    				                    } else {
    				                        player.getPackets().sendMessage(99, "You have no items waiting for you.", player);
    				                    }
    				                } catch (Exception e){
    				                    player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
    									player.getPackets().sendGameMessage(
    								"<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.");
    										}
    				                    return true;
    				     }
    Remove the "s" from "players"
    Compiled, no errors but I did ::claim after voting and there was no yell message
    Reply With Quote  
     

  5. #5  
    guinea lord
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    18
    Posts
    1,456
    Thanks given
    239
    Thanks received
    503
    Rep Power
    56
    Quote Originally Posted by Lost Redemption View Post
    Code:
    			if (cmd[0].equalsIgnoreCase("claim")) { 
    				   try { 
    				     VoteReward reward = MainLoader.hasVoted(player
    				       .getUsername().toLowerCase().replaceAll(" ", "_"));
    				     if (reward != null) {
    				     switch (reward.getReward()) { 
    				       case 0:
    				    	   player.getInventory().addItem(24155, 1);
    						   player.getInventory().addItem(2996, 1);
    				    	   break;
    				                            case 1:
    				                               
    				                                break;
    				       case 2:
    				     
    				        break;
    				                            //add more here
    				                            default:
    				                                player.getPackets().sendMessage(99, "Reward not found.", player);
    				                                break;
    				                        }
    				                        player.getPackets().sendMessage(99, "Thank you for voting.", player);
    				                    } else {
    				                        player.getPackets().sendMessage(99, "You have no items waiting for you.", player);
    				                    }
    				                } catch (Exception e){
    				                    player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
    									player.getPackets().sendGameMessage(
    								"<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.");
    										}
    				                    return true;
    				     }
    Remove the "s" from "players"
    You're both stupid as ****, did you read this thread? If he removes the s, it will only send it to that one player.

    As for ace hood USE WHAT I POSTED, NOT HARD.
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    May 2007
    Posts
    2,692
    Thanks given
    117
    Thanks received
    46
    Rep Power
    0
    Change This:
    Quote Originally Posted by Ace Hood View Post
    players.getPackets().sendGameMessage(
    "<img=6><col=ff8c38>News: "
    + player.getDisplayName()
    + " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.");
    To This:
    Code:
    World.sendWorldMessage("<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.
    Reply With Quote  
     

  7. #7  
    Donator

    Join Date
    Mar 2012
    Posts
    466
    Thanks given
    26
    Thanks received
    20
    Rep Power
    11
    Quote Originally Posted by Shabbaboi View Post
    Change This:


    To This:
    Code:
    World.sendWorldMessage("<img=6><col=ff8c38>News: "
    										+ player.getDisplayName()
    										+ " Has just voted and has recieved two spins and a Vote ticket, do ::Vote to recieve yours.
    Got this:
    Reply With Quote  
     

  8. #8  
    EnigmaⱣƘ
    Chief Sosa's Avatar
    Join Date
    Jun 2012
    Posts
    761
    Thanks given
    102
    Thanks received
    159
    Rep Power
    28
    Code:
    World.sendWorldMessage("<img=6><col=ff8c38>News: " + player.getDisplayName() + " Has just voted and has received two spins and a Vote ticket, do ::Vote to receive yours.");

    Reply With Quote  
     

  9. #9  
    Donator

    Join Date
    Mar 2012
    Posts
    466
    Thanks given
    26
    Thanks received
    20
    Rep Power
    11
    Quote Originally Posted by Lean. View Post
    Code:
    World.sendWorldMessage("<img=6><col=ff8c38>News: " + player.getDisplayName() + " Has just voted and has received two spins and a Vote ticket, do ::Vote to receive yours.");
    Reply With Quote  
     

  10. #10  
    guinea lord
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    18
    Posts
    1,456
    Thanks given
    239
    Thanks received
    503
    Rep Power
    56
    I hope you know you have that in the Exception part of your code.
    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)

Similar Threads

  1. [718]World message when someone gets a drop
    By Monum3ntal in forum Snippets
    Replies: 48
    Last Post: 04-06-2014, 01:11 PM
  2. Replies: 15
    Last Post: 03-06-2013, 03:31 PM
  3. Server message when player gets a rare drop.
    By Mr Joopz in forum Requests
    Replies: 6
    Last Post: 01-26-2013, 09:07 AM
  4. Replies: 3
    Last Post: 07-12-2012, 05:53 PM
  5. Replies: 5
    Last Post: 02-21-2012, 07:53 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
  •