[ADMN/MISC] LoginBonus v0.6 - Reward Loyal Players When They Login. [1185]

Discussion in 'Inactive/Unsupported Plugins' started by BeerHuntor, Sep 10, 2011.

  1. [​IMG]



    LoginBonus - Reward Loyal Players
    Version: v0.6

    <font color="rgb(255, 0, 0)">Now on bukkitdev </font>http://dev.bukkit.org/server-mods/loginbonus/

    This is one of my first plugins that I have built, nothing special, quite simple really, but I thought
    I would share this anyway.

    Features:
    * Rewards players on login with a diamond.
    * Automatically goes into the players inventory
    * Permissions Supported
    * Now only activates every 24hours.
    * Reward is configurable.
    * Time is configurable.

    Permission Nodes:

    LoginBonus.true

    <Edit by Moderator: Redacted mediafire url>


    Show Spoiler
    Code:
    package me.beerhuntor.LoginBonus;
    
    import java.util.logging.Logger;
    
    import me.beerhuntor.LoginBonus.LoginBonus;
    
    import org.bukkit.event.Event;
    import org.bukkit.event.Event.Priority;
    
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class LoginBonus extends JavaPlugin{
    
        LoginBonusPlayerListener playerListener = new LoginBonusPlayerListener(this);
        private Logger log = Logger.getLogger("Minecraft");
    
        public void onEnable() {
            PluginManager pm = this.getServer().getPluginManager();
    
            pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
            this.logMessage(" Has been enabled.");
        }
    
        public void onDisable() {
    
            this.logMessage(" Has been disabled.");
        }
    
        protected void logMessage(String msg){
            PluginDescriptionFile pdFile = this.getDescription();
            this.log.info("[" + pdFile.getName() + "]" + " " + pdFile.getVersion() + ": " + msg);
        }
    
    }
    
    Code:
    package me.beerhuntor.LoginBonus;
    
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    
    import org.bukkit.entity.Player;
    
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerListener;
    
    import org.bukkit.inventory.ItemStack;
    
    public class LoginBonusPlayerListener extends PlayerListener{
    
        public LoginBonus plugin;
    
        public LoginBonusPlayerListener(LoginBonus instance){
            this.plugin=instance;
        }
    
        public void onPlayerJoin(PlayerJoinEvent event){
    
            Player p = event.getPlayer();
            ItemStack i = new ItemStack(Material.DIAMOND,1);
    
            if(p.hasPermission("loginbonus.true")){
    
            p.getInventory().addItem(i);
    
            p.sendMessage(ChatColor.AQUA + "You have recieved a Login Bonus of a Diamond! ");
            }
        }
    
    }
    



    To Do.

    * Add Config File to allow more configuration - Added v0.3

    * Add a timer so it can only be used every 24hours? - Added v0.2 (Thanks @tips48)
    * Add iConomy Support (WIP)

    ChangeLog:

    version 0.6 -
    Fixed the configuration syntax error when creating the config file


    version 0.5 -
    Simplified the time configuration from milliseconds to hours


    Show Spoiler
    version 0.4 -
    Made the time as a configurable option.

    version 0.3 -
    Added config file. Reward is now configurable.

    version 0.2 -
    Added the source to only allow the bonus to be given once every 24 hours - Thanks to @tips48

    version 0.1 -
    Released LoginBonus
     
    Last edited by a moderator: Nov 12, 2016
  2. Updated to build 1185 :)
     
  3. Offline

    Mazeash

    Very useful, the only plugin I can find that does this job without the need for economy.

    Only one thing though, would it be possible to add the ability to change the on screen message in a future update?

    Very much appreciated!!
     
  4. Offline

    Pomme72

    Update please
     
  5. Offline

    kyle921

    Looks like BeerHuntor dropped off the face of the Earth... Disappointing--I was hoping to use this plugin on my server as a new gimmick.
     
  6. Offline

    Xerex22222

    Only the ops get a diamond why?

    I have set everything correct:

    shorten version:

    Member:
    default: false
    info:
    prefix: '&3'
    suffix: ''
    build: true
    inheritance:
    - Gast
    permissions:
    - LoginBonus.true
     
  7. Offline

    jespertheend

    Can you add a custom message option in the config.yml? And damage values. Because I want to give lapiz Lazui
     
  8. Offline

    chisox8

    For some reason, sometimes my users are getting the loginbonus 2 times per day (i just set my hour period to 48 hrs, could that have reset it?) Also, does it reset when you reload the server (/reload) so that players get the bonus again?

    Thanks!
     
  9. Offline

    chisox8

    Please, I really need help with this. It seems that somebody can get more than one login reward per day by logging in then logging out... waiting... then logging back in! I don't know how this is happening and it doesn't always work (maybe it is causes by reloads?) Please help! Thanks!
     
  10. Offline

    Slime

    hey, I love the plugin, but still waiting for the Economy support, so that you can reward your players in $.
    anyways good plugin, can't make anything bad of it exept the Economy support part :D
    waiting for it ! :)
     
  11. Offline

    Slime

    Update the Iconomy support plz!
     
  12. Offline

    Gingerninjaprsn

    Sigh, where's the update?
     
  13. Offline

    connerreinhardt

    Can you please update so this is compatible with 1.2.3-R0.1 Beta Build.
     
  14. Offline

    md_5

    Long time no see BeerHuntor. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     
  15. I am currently getting back into coding and modding, I will be updating my plugins to the current version of bukkit and MC, no ETA time frame yet. Sorry for the long time off, I had irl issues that prevented me from continuing, so having to learn to recode again. Hopefully soon you will have an updated version.

    md_5 understood my friend.
     

Share This Page