[Formatted] Simple referring plugin

Discussion in 'Archived: Plugin Requests' started by MetalMadness, Jan 21, 2012.

  1. Offline

    MetalMadness

    Plugin category: GEN/ECON?

    Suggested name: Referring or whatever)

    A bit about me: Cheezecake

    What I want:
    (what I would like in the first release)
    Compatible with iconomy.
    Reward for the (player) (item or money)
    can only do it once
    (could be added later)
    +other major economy plugins
    reward for the person using /refer
    (custom)MOTD if you didnt refer anyone

    Ideas for commands: /refer (name) will give the (name) a reward for referring someone. Can only be used once
    /refer view [player]. View the list of players you
    (/refer can be like referedby or whatever.)

    Ideas for permissions: refer.refer refer.view refer.view.player

    Willing to pay up to: $0 - but I will be giving any properly formatted posts a lot more attention than poorly formatted ones.

    When I'd like it by: As soon as possible? Is a week fine? Take your time

    Similar plugin requests: None.

    bump. i know other people would want this

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
    Vincent1468 likes this.
  2. Offline

    ArcheCane

    Me and my friend have been working on pretty much this, I'll give ya a bump when it's done.
     
    MetalMadness likes this.
  3. Offline

    MetalMadness

    thanks :)
     
    Vincent1468 likes this.
  4. Offline

    MetalMadness

    bump
     
    Vincent1468 likes this.
  5. Offline

    turt2live

  6. Offline

    MetalMadness

    Pretty much, but I would like it to give the people who refered the person money... But yeah very similar
     
    Vincent1468 likes this.
  7. Offline

    K_Cin

    If you are interested:
    Scroll down for info about version 0.2!

    Since no one seems to be interested in creating this quite easy plugin for you I decided to do so. Result:

    Referrer v0.1
    Description: I tried to make this plugin match your description as close as possible. This plugin allows players with the permission node (referrer.referrer) to use a command (/referrer <player>) which will check if a player already has told the server they were referred by someone. If the server returns false it will send a reward to the referrer and saves who has referred the player. To see who has referred a certain player use /referred player <player> or you could use /referred list <player> to see what players were referred by that player. For the last two commands a user needs the permission node: referrer.referred

    I also included a function to automatically ask a player to tell the server by whom they where referred. I added this as a configurable option because some server owners might find it annoying.

    Commands:
    • /referrer <player>
    • /referred <list|player> <player>
    Configuration: Example:
    Code:
    Money:
      Reward: 100
      Currency: $
    OnPlayerJoin: true
    This plugin depends on Vault, so it supports all economy and permissions plugins Vault does.

    Download Referred v0.1
     
  8. Offline

    MetalMadness

    GREAT! Gonna test it right now! :D
     
    Vincent1468 likes this.
  9. Offline

    K_Cin

    Don't forget to also check out this topic.
     
    Vincent1468 and MetalMadness like this.
  10. Offline

    MetalMadness

    @K_Cin
    First thing
    Thank you so much :D

    Second, glitch/fix time :D
    -Could you make it so the player doesn't have to be online to be referred?
    -I tried it with a player offline, said I couldn't and can't use the command again (ie, someone referes someone but puts a typo, then they can't refer anyone)
    -Possible reward for the person who did /referred ? Can be added later :)

    Also, where is the DB with who referred who? JW :p

    Thanks again :D
     
    Vincent1468 likes this.
  11. Offline

    K_Cin

    Q: Could you make it so the player doesn't have to be online to be referred?
    A: I will. I just used this method to make sure the player exists.

    Q: I tried it with a player offline, said I couldn't and can't use the command again (ie, someone referes someone but puts a typo, then they can't refer anyone)
    A: I'm sorry, I think I forgot to tell the plugin to not save it in the database if the user doesn't exist. :oops:

    Q: Possible reward for the person who did /referred ?
    A: It's already in there! Just check the config and make sure you have Vault and a economy plugin installed and working.

    Q: Also, where is the DB with who referred who?
    A: Check the config. ;)
     
    Vincent1468 likes this.
  12. Offline

    MetalMadness

    in that case, a reward for the person who referred the player :D /referrer (this guy)
    Ahh ok, because I did a offline person :p
     
    Vincent1468 likes this.
  13. Offline

    K_Cin

    I forgot to mention:
    The player mentioned on /referrer <player> will recieve the reward.

    So you want the player who used /referrer to also get a reward? If yes: should it be the same amount of money or an amount that can be configured apart?
     
    Vincent1468 likes this.
  14. Offline

    MetalMadness

    apart please :D
     
    Vincent1468 likes this.
  15. Offline

    K_Cin

    MetalMadness

    I have fixed the things mentioned the things above. In your config replace Reward with
    Code:
    Money:
      Referrer: 100
      Referred: 50
    Referrer => The amount of money the referrer gets.
    Referred => The amount of money the one that got referred gets.

    Download Referred v0.2
     
    Vincent1468 and MetalMadness like this.
  16. Offline

    MetalMadness

    K_Cin Great! I will test it out right now :D

    @K_Cin
    Works great so far, except for offline players :'(

    An internal error occurred while attempting to perform this command
    Code:
    2012-02-26 08:04:42 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'referrer' in plugin Referred v0.2
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:402)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:784)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:744)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:732)
        at lishid.orebfuscator.hook.NetServerHandlerProxy.a(NetServerHandlerProxy.java:101)
        at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100)
        at lishid.orebfuscator.hook.NetServerHandlerProxy.a(NetServerHandlerProxy.java:44)
        at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:537)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:435)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    Caused by: java.lang.NullPointerException
        at me.kcin.Referred.Referred.onCommand(Referred.java:107)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 14 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
    Vincent1468 likes this.
  17. Offline

    K_Cin

    Updated the version 0.2 file. Use the download link above.
     
    Vincent1468 likes this.
  18. Offline

    MetalMadness

    K_Cin Still getting the error :/
     
    Vincent1468 likes this.
  19. Offline

    K_Cin

    Code:
    Caused by: java.lang.NullPointerException
        at me.kcin.Referred.Referred.onCommand(Referred.java:107)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 14 more
    Are the following lines still the same?


    And could you tell me what command + arguments you used?
     
    Vincent1468 likes this.
  20. Offline

    MetalMadness

    You
    Code:
    Caused by: java.lang.NullPointerException
        at me.kcin.Referred.Referred.onCommand(Referred.java:107)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 14 more
    Me
    Code:
    Caused by: java.lang.NullPointerException
        at me.kcin.Referred.Referred.onCommand(Referred.java:107)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 14 more
    /referrer (offline person)
     
  21. Offline

    K_Cin

    I rewrote that part of the code again. It should now handle offline people better. Download the v0.2 again and replace the jar to update.
     
  22. Offline

    MetalMadness

    K_Cin Works :D thanks :D

    K_Cin Permissions don't work :x

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

    K_Cin

    Do you mean that you instantly have all permissions? If so: check if you're an operator (op), since those have all nodes. If this isn't true then tell me which Permissions plugin (+version) and Craftbukkit version you use so I can perform some tests.
     
  24. Offline

    MetalMadness

    no, people with referrer.referrer can't use the command

    pex 1.17
     
  25. Offline

    K_Cin

    Code:
    permissions:
        referred.referrer:
            description: Allows you to say by whom you've been referred.
        referred.referred:
            description: Allows you to check by who a player has been referred.
    I see I'm the one who said different above, I'm sorry.
     
  26. Offline

    MetalMadness

    don't be sorry! You made an two awesome plugins :D

    Thanks :D
     
  27. Offline

    K_Cin

    • Made the plugin compatible with the latest craftbukkit.
    • Killed the download links for 0.1 and 0.2.
    Download Referred v0.3
     
    ArcheCane likes this.
  28. Offline

    TopGear93

  29. Offline

    antares330

    I wish so bad i could find a refer plugin that allows you to give with a command!
    Thanks
    Justin
     

Share This Page