/vote command

Discussion in 'Archived: Plugin Requests' started by MCE626, Dec 13, 2012.

  1. Offline

    MCE626

    is there a plugin that u can type /vote and it gives u a link to a forum topic with links to vote for the server?
    Thanks!
     
  2. Offline

    pointfit

    I would like something like this to. Like if you type /vote, it will show what you typed in into a customizable config just like /rules or /motd
     
    MCE626 likes this.
  3. Offline

    MCE626

    that is exactly what i was thinking too
     
  4. Offline

    fireblast709

    Anyone care to compile this (as I don't tbrh :p)?
    Code:java
    1. package com.github.DarkSeraphim.ServerVote;
    2.  
    3. import java.util.ArrayList;
    4.  
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8.  
    9. public class ServerVote extends JavaPlugin
    10. {
    11. @Override
    12. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
    13. {
    14. if(label.equals("vote"))
    15. {
    16. ArrayList<String> sites = (ArrayList<String>)getConfig().getStringList("votes");
    17. String prefix = getConfig().getString("prefix", "Please vote for our server here: ");
    18. if(sites == null)
    19. {
    20. this.getLogger().warning("No websites found for voting!");
    21. sender.sendMessage("No websites found. Please inform an administrator of this.");
    22. }
    23. else
    24. {
    25. for(String site : sites)
    26. {
    27. sender.sendMessage(new StringBuilder().append(prefix).append(site).toString());
    28. }
    29. }
    30. }
    31. return true;
    32. }
    33. }
     
    pointfit likes this.
  5. Offline

    pointfit

    fireblast709

    Does everyone get /vote by default or is there a permission? Btw thanks.
    And thanks MCE626 for requesting this
     
  6. Offline

    fireblast709

    pointfit anyone has the permission
    [edit] let me tag you so you get the alert :3
     
  7. Offline

    pointfit

    Ok thanks :)

    Someone compile this please D:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  8. Offline

    jorisk322

    MCdocs and variabletriggers can do this.
     
  9. Offline

    astroskillz

    This can be achieved with MCDocs (Works perfect on my server).
     
  10. Offline

    Stevensaurus

  11. Offline

    MCE626

    :D thank you very much! this is exactly what i wanted. and it's easy to configure. thanks! [diamond][diamond][cake]
     
  12. Offline

    Stevensaurus

    No problem, happy to help.
     

Share This Page