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 Server message when someone votes
    Server message when someone votes

    Join Date
    Mar 2012
    Posts
    515
    Thanks given
    27
    Thanks received
    22
    Rep Power
    0
    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;
    				     }

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Exoria Server message when someone votes
    Server message when someone votes
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    20
    Posts
    1,459
    Thanks given
    239
    Thanks received
    498
    Rep Power
    56
    World.sendWorldMessage("");
    Reply With Quote  
     

  3. #3  
    Lost Redemption Owner & Founder Server message when someone votes
    Server message when someone votes
    Lost Redemption's Avatar
    Join Date
    Jan 2013
    Age
    19
    Posts
    915
    Thanks given
    212
    Thanks received
    60
    Rep Power
    0
    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 Server message when someone votes
    Server message when someone votes

    Join Date
    Mar 2012
    Posts
    515
    Thanks given
    27
    Thanks received
    22
    Rep Power
    0
    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  
    Exoria Server message when someone votes
    Server message when someone votes
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    20
    Posts
    1,459
    Thanks given
    239
    Thanks received
    498
    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 Server message when someone votes

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    117
    Thanks received
    45
    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 Server message when someone votes
    Server message when someone votes

    Join Date
    Mar 2012
    Posts
    515
    Thanks given
    27
    Thanks received
    22
    Rep Power
    0
    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:
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Donator Server message when someone votes
    Server message when someone votes

    Chief Sosa's Avatar
    Join Date
    Jun 2012
    Posts
    1,032
    Thanks given
    22
    Thanks received
    209
    Rep Power
    82
    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 Server message when someone votes
    Server message when someone votes

    Join Date
    Mar 2012
    Posts
    515
    Thanks given
    27
    Thanks received
    22
    Rep Power
    0
    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.");
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Exoria Server message when someone votes
    Server message when someone votes
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    20
    Posts
    1,459
    Thanks given
    239
    Thanks received
    498
    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: 63
    Last Post: 07-03-2015, 02:55 AM
  2. Replies: 15
    Last Post: 03-06-2013, 04:31 PM
  3. Server message when player gets a rare drop.
    By Mr Joopz in forum Requests
    Replies: 6
    Last Post: 01-26-2013, 10:07 AM
  4. Replies: 3
    Last Post: 07-12-2012, 05:53 PM
  5. Replies: 5
    Last Post: 02-21-2012, 08: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
  •