Thread: [pi] GTL VOTE

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [pi] GTL VOTE 
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    Is there a way when someone votes it broadcasts it to the server saying that the player has voted.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Oct 2013
    Age
    25
    Posts
    685
    Thanks given
    15
    Thanks received
    68
    Rep Power
    0
    Quote Originally Posted by fourshorty View Post
    Is there a way when someone votes it broadcasts it to the server saying that the player has voted.
    When you claim your reward do something alike this.

    Code:
    c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
    Reply With Quote  
     

  3. #3  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    Quote Originally Posted by Dri Comics View Post
    When you claim your reward do something alike this.

    Code:
    c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
    Ty ty I will try it.
    Reply With Quote  
     

  4. #4  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    Quote Originally Posted by Dri Comics View Post
    When you claim your reward do something alike this.

    Code:
    c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");

    Code:
    src\server\model\players\packets\Commands.java:219: error: cannot find symbol
                                                       c2.sendMessage("[VOTE]: "+c.p
    layerName+" has just voted Make sure you vote as well!");
                                                       ^
      symbol:   variable c2
      location: class Commands

    The command itself
    Code:
    if (playerCommand.equalsIgnoreCase("claim") || playerCommand.equalsIgnoreCase("reward")) {
                try {
                    VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
                    if(reward != null){
                        switch(reward.getReward()){
                            case 0:
                               c.getItems().addItem(6199, 1);
    						   c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
                                break;
                            case 1:
    							c.getItems().addItem(10934, 1);
    							c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
    							break;
                            
                            default:
                                c.sendMessage("Reward not found.");
                                break;
                        }
                        c.sendMessage("Thank you for voting.");
                    } else {
                        c.sendMessage("You have no items waiting for you.");
                    }
                } catch (Exception e){
                    c.sendMessage("[GTL Vote] A SQL error has occured.");
                }
            }
    Reply With Quote  
     

  5. #5  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    I even moved where the c2 thing is

    Code:
    if (playerCommand.equalsIgnoreCase("claim") || playerCommand.equalsIgnoreCase("reward")) {
                try {
                    VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
                    if(reward != null){
                        switch(reward.getReward()){
                            case 0:
                               c.getItems().addItem(6199, 1);
                                break;
                            case 1:
    							c.getItems().addItem(10934, 1);
    							break;
                            
                            default:
                                c.sendMessage("Reward not found.");
                                break;
                        }
                        c.sendMessage("Thank you for voting.");
    					c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
                    } else {
                        c.sendMessage("You have no items waiting for you.");
                    }
                } catch (Exception e){
                    c.sendMessage("[GTL Vote] A SQL error has occured.");
                }
            }
    Reply With Quote  
     

  6. #6  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    bump
    Reply With Quote  
     

  7. #7  
    Registered Member cannabiss's Avatar
    Join Date
    Nov 2013
    Posts
    379
    Thanks given
    9
    Thanks received
    21
    Rep Power
    19
    declare variable c2.
    Reply With Quote  
     

  8. #8  
    Ratted Donor

    Join Date
    Feb 2013
    Posts
    675
    Thanks given
    117
    Thanks received
    59
    Rep Power
    21
    Code:
    PlayerHandler.yell("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
    Make sure you have the method "yell" in your playerhandler.

    Could be done otherwise but this is better

    Quote me if you dont have it.
    [CENTER]
    Spoiler for Vouches (2):

    Quote Originally Posted by SHIFT_ View Post
    Great doing business! Bought 75M purchased relatively smoothly.
    Quote Originally Posted by Luzoxpk View Post
    bug fixed thanks linas


    Spoiler for Peeps i respect::

    Arham 4 , Sheepmonger , Linus, LuzoxPk (ipkmills)
    Reply With Quote  
     

  9. #9  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    Quote Originally Posted by linas View Post
    Code:
    PlayerHandler.yell("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
    Make sure you have the method "yell" in your playerhandler.

    Could be done otherwise but this is better

    Quote me if you dont have it.
    No I don't have a Yell method
    Reply With Quote  
     

  10. #10  
    Registered Member fourshorty's Avatar
    Join Date
    Oct 2013
    Posts
    148
    Thanks given
    17
    Thanks received
    10
    Rep Power
    11
    Quote Originally Posted by cannabiss View Post
    declare variable c2.
    Spoonfeed me please? lol
    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: 1
    Last Post: 11-16-2013, 02:15 AM
  2. GTL Vote Help [PI]
    By i am here in forum Help
    Replies: 2
    Last Post: 03-10-2013, 11:11 PM
  3. [PI] Adding ::vote command
    By Beanerrr in forum Help
    Replies: 2
    Last Post: 03-13-2011, 01:52 AM
  4. [PI] Buying vote for cash or clipped follow
    By Slay No More in forum Buying
    Replies: 0
    Last Post: 03-07-2011, 03:05 AM
  5. [PI] Implement Vote For Cash etc
    By amada in forum Requests
    Replies: 5
    Last Post: 01-16-2011, 08:43 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
  •