Inactive [ADMN/MISC]ReferGift v1.0.9 - Refer a friend & receive a gift![BROKEN] [1.4.6 - R0.3]

Discussion in 'Inactive/Unsupported Plugins' started by TopGear93, Mar 15, 2012.

  1. Offline

    TopGear93

    ReferGift
    v1.0.9

    If you refer a friend to the server your on, the server will gift you a configurable item with a configurable amount! For you to recieve this gift you must have your friend type /referedby <yourname>.

    Description:
    • safety Checks so people cant constantly refer themselves or friends.
    • command locking system. Command only can be used once per person.
    • configurable gifts with amounts.
    • broadcasts who refered whom.
    • saves a list in the config of who used the command.
    • saves a list in the config of who refered whom.
    Commands:

    checks plugin version
    /rg version

    refering command
    /referredby <name>

    reloads config + server
    /rg reload

    player wasnt refered but still receives gift
    /notreferred

    Permissions:
    Code:
    refergift.config.reload
    refergift.referrals
    refergift.referredby
    refergift.notreferred
    refergift.version
    
    Requirements:
    Vault + any permissions system + economy

    Configuration Template:
    Show Spoiler

    Code:
    # ReferGift
    refergift:
      title: ReferGift
      alreadyreferred: You have already been listed!
      getreferredby: ' got referred by '
      YouWereRewarded: You have been rewarded
      thanksfor: 'Thanks for refering '
      configreloaded: Configs reloaded!
      noreferself: You can't refer yourself you silly goose!
      confignoperms: No permissions to reload config!
      playernotavailable: Player is not available!
      offlinegiftmsg: Thanks for refering a player to the server!
      wereyoureferred1: If you were referred to this server type or if you were not referred type
      wereyoureferred2: /referredby <player>
      wereyoureferred3: /notreferred
      savingitemtofile: Saving gift to file!
      referredgeneralnoperms: No permissions to use /referredby!
      notreferredmsg: Thanks for choosing our server!
      playerreferralamount: ' referred '
      notreferrednoperms: No permissions to use /notreferred!
      playersingular: ' player'
      playerhasnoinfo: has not referred a player!
      playermultiple: ' players'
      nicetrynoloopholes: Nice try! Dont use loopholes!
      alreadynotreferred: You have already referred someone!
      ranoutoftimemsg: You ran out of time to refer someone! You cannot try again!
      thanksforgiftmsg: Thanks for refering a player to our server!
      notreferredmsg2: You said that you were not referred! You cannot try again!
      versionnoperms: No permissions to check version!
      typetochat: type /chat on
      totalnoperms: No permissions to check referring totals!
      welcomemsg: 'Welcome back '
      thereferrer: You have referred someone. You cant be the referred one!
      gift: '56'
      notreferred:
        gift:
          gift: '56'
          amount: 1
        moneyamount: 10
      amount: 1
      referredby:
        moneyamount: 10
      delay: 1200
      money:
        switch: true
      welcomemessage:
        switch: true
    
    Code:
    #DO NOT EDIT THIS FILE. IF YOU DO THERE WILL BE ERRORS! I WILL NOT SUPPORT THOSE WHO EDIT THIS FILE!
    #THIS FILE CONTAINS ALL LISTS THAT ARE USED TO STORE PLAYER NAMES!
    #NotReferred[]
    #ReferredList[]
    #RewardSave[]
    #TheReferred[]
    #TheReferrer[]
    

    Gifts run off of IDs.
    thereferred = the referred player
    referredlist = list of who refered whom.
    thereferrer = who referred the player
    notreferred = who wasnt referred
    nochatting = list of who cant chat
    rewardsave = who gets their offline reward

    welcomemessage:switch: true
    When this is set to true, all returning players will receive a welcome message. When this is false they wont get the message.
    money:switch: true
    When this is set true then the player will receive money instead of blocks.

    Metrics:
    http://mcstats.org/plugin/ReferGift

    Download:
    https://dl.dropbox.com/u/1015938/plugins/ReferGift.jar


    BukkitDev:
    http://dev.bukkit.org/server-mods/refergift/

    Todo:
    Show Spoiler

    • proper chatting system
    Changelog:

    v1.0.8 - Semi rebuilt
    • Fixes all deprecations.
    • Fixes a couple silly command issues.
    • Removed chatting system till I get a proper one going.
    • started working on a new arraylist system.
    v1.0.9 - small update
    • Cleaned up plugin. file size is smaller
    • adds seperate file for arraylists only. Loads, saves, and fully understands the new file. file is called "lists.yml". its' located with the default config in the ReferGift folder.
    • Shutoff server and delete the old refergift folder. Start server with v1.0.9 installed and the new file will generate. Why should you delete the other config? It just prevents errors.
    Issues:

    Plugin wont work? Follow this form.
    • Plugin version your running
      -
    • Server version your running
      -
    • Java version your PC/server is running
      -
    • What did you do that caused this error? Be specific!
      -
    • Are you renting a server or are you dedicated? yes or no
      -
    • Provide photo evidence or possible video evidence.
      -
    • Getting a NPE? Any errors popping up in the console? Show me them within a
      -
      Code:
      
      
    if you find any -
    • Spelling issues
    • backward configs
    • bad permission nodes
    • or any other ridiculous issues post them here politely.
    Common errors while using my plugins:

    Lists not saving to correct location:
    • Fix - Stop server, delete config, restart server.
    [​IMG]
    Based on a work at ReferGift
    Permissions beyond the scope of this license may be available at TopGear93 Profile.
    [​IMG]
     
  2. Offline

    md_5

    Approved
     
  3. Offline

    JPW

    Can you please add another Permission node for using the /refer command? I mean that only members can use it. (offline-server)
    Thank you,
    JPW
     
  4. Offline

    migsthegod

    Awesome!
    However i found a bug,

    If a player uses caps on his name, he can refer HIMSELF.

    Ex: MyNAmE <-player name
    player can refer self by using /referedby myname <-- note: no caps

    Could you make it case sensitive? :D
     
    TopGear93 likes this.
  5. Offline

    JamieSinn

    you might want to add a anti self use by using the sender/target players
     
  6. Offline

    CayceH

    I have gotten this error:
    Show Spoiler
    17:39:26 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'referedby' in plugin ReferGift v0.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:469)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:907)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:867)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:850)
    at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:33)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:116)
    at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.RuntimeException: Permissions manager is not accessable. Is the PermissionsEx plugin enabled?
    at ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager(PermissionsEx.java:150)
    at ru.tehkode.permissions.bukkit.PermissionsEx.getUser(PermissionsEx.java:157)
    at ru.tehkode.permissions.bukkit.superperms.PermissiblePEX.isPermissionSet(PermissiblePEX.java:199)
    at org.bukkit.permissions.PermissibleBase.hasPermission(PermissibleBase.java:71)
    at ru.tehkode.permissions.bukkit.superperms.PermissiblePEX.checkPermission(PermissiblePEX.java:112)
    at ru.tehkode.permissions.bukkit.superperms.PermissiblePEX.hasPermission(PermissiblePEX.java:101)
    at org.bukkit.craftbukkit.entity.CraftHumanEntity.hasPermission(CraftHumanEntity.java:99)
    at org.bukkit.craftbukkit.CraftServer.broadcast(CraftServer.java:958)
    at org.bukkit.craftbukkit.CraftServer.broadcastMessage(CraftServer.java:322)
    at org.bukkit.Bukkit.broadcastMessage(Bukkit.java:122)
    at us.topgear93.refergift.ReferGift.onCommand(ReferGift.java:71)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
    ... 12 more

    EDIT: I think it is a problem with PermissionsEX just want to make sure.
     
  7. Offline

    kahlilnc

    Support Moniez? :(
     
  8. Offline

    FreeZoneCraft

    I agree bro! Add eco support Iconomy4-5-6 and BOSEco :D
     
  9. Offline

    HARDLINE_98

    You should so you can make the console perform commands and make them last a certain amount of time after somebody has been referred. Also if they refer a certain amount of people it performs a different command.
     
  10. I agree too, i would like to see eco support added :)
     
  11. Offline

    columb

    Permission to use /referedby <name>? Would be useful for server with permission based whitelist.
     
  12. Offline

    gustebeast

    Suggestions:
    • If the new player puts the referrer as someone who isn't online, the 'gift' is stored until that player logs in.
    • Prevent the "refer yourself" glitch where you type your own name with odd capitalization. For instance, /referedby GuStEbEaSt gives me the reward.
    • Make a time out. The new player (newbie) only has X seconds to type the command after joining.
    • If that time expires, the newbie is logged into the system as not referring anyone.
    • A command for newbies who wern't referred (e.g. /referredby none, or /notreferred)
    • A system to shut off outside chat for the newbie (to prevent others from tricking the newbie)
    • Permissions for the refer command (to prevent advanced groups from using it)
    • Checks previous players to integrate a 'Did you mean?' system. If newbie types /referredby doug, it would reply back, "Do you mean 'doug378'?". This would make it more simple for the newbie.
    • Make messages configurable (Just to be complete)
     
  13. Offline

    painisgod

    how do i change so you can only gain 3 diamonds?
     
  14. Offline

    gustebeast

    Thanks for looking at the suggestions, preferably do them top to bottom, as I rated them in importance.
    P.S. thanks, ive been looking for a plugin of this nature for ages :D

    Yes. If i was an average player looking for rewards, I would hang out at the spawn and, when a new person joined, immediatly say "if you type /referedby gustebeast, ill give you 10 iron!". The new player, would of course do it, not knowing what the command does. I think this would be a big problem, and that the only solution is to turn off chat for the player. One example is Buycraft, when you type /buy, it opens up a chat thing, and you dont recieve any chat from anyone else. Here it would be the same way, except the chat would be off until the person typed the command. (by outside chat, I just mean all global chat)

    Also, a note about the capitalization error. Please don't fix it by adding case sensitivity, as this would make it much harder for the new player to get the username right. Instead, you should actually remove capitalization entirely, so if the newbie types /referedby GuStEbEaSt, the plugin would read it as gustebeast, instead of replying "that user doesn't exist"

    any idea on how long the delay feature might take? just wondering cause i could implement this plugin now and work around the delay, or could have it built in.

    Its 5:47 now, so it would be ready at around 8?
    Oh and could you get the gift storage feature in too? Those are the two features I need to be able to run it.

    if you can, get storage instead of delay. Without storage, the person needs to be online at the time, usually when I refer people, it is at school or something, they wouldn't necessarily join at a time when I was online.

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

    duker02

    Sorry to be such a pain, but my OCD is kicking in. Can you please change the command to /referredby? I see that in all of your commands you spelled "referred" wrong. Sorry, but I love this plugin and it's bugging me that people have to type in a misspelled command.
     
    TopGear93 likes this.
  16. Offline

    gustebeast

    Hey TopGear, you made messages configurable, but not entirely. Could you make it show exactly what appears in chat. So in the config it would be say...
    ( getreferedby: [&cReferGift&f] &6 ' &fgot refered by &6 ' ) instead of ( getreferedby: ' got refered by ' )
    I ask because I might want to change the prefix [ReferGift] to [RG] and I probably will want to change the color scheme.
    And yes please do fix refered to referred

    sounds good! Please do post up any stable versions you land at though :), even if all the to-do's arn't there yet.
    P.S. I could help u test if u need it.

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

    Ebins

    I can't get this to work for iPermissions. It only works when Owner/Op does the referral.. doesn't work for anyone else. They all have the permission refergift.allow.... any suggestions? My users REALLY want this! :D
     
  18. Offline

    gustebeast

    I have a great idea! dont use iPermissions! PermissionsBukkit works for any node, and is easy to use.
     
  19. Offline

    Ebins

    Oops, I said iPermissions? Sorry, that was a major typo.. I AM using bPermissions and I also have vault installed. =/ I don't get any error messages when the server is loading, so I don't know what the issue is :(
     
  20. Offline

    gustebeast

    No worries, most developes dont even listen to the issues that given to them, your fast compared to the ones I've worked worked with!

    Also, can you open your profile to the public? Its just kind of annoying to not know when your online or when u were last online.

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

    bellettiboy

    ok i fricking love this plugin about 10 of my players bring there firiends now thank yyou so muchhh ::))))0
     
    TopGear93 likes this.
  22. Offline

    Rowtag

    Command doesn't work for me /referedby or /notrefered, just shows unknown command.
     
  23. Offline

    peng_bears

    waiting on a couple of todos to be completed but this looks like a good idea and nice plugin, will be checking it out soon, good work
     
  24. Offline

    donald1440

    hi i have a feature request.

    right now it seems like you can refer one alredy on the server, but what if the player that wanted to recive a reward have to use /refer [name] before the player joins for the first time? then u can be sure its not cheating
     
  25. Offline

    Switch0r

    Thanks for this wonderful plugin, but could someone explain the config a bit.
    I only want to gift money.

    Edit: is it normal that players can refer themself?
     
  26. Offline

    gustebeast

    set the gift ID to 0, that will give them nothing. then switch money on, and set your amount
     
  27. Offline

    robot56

    Can you add a permissions node for the person that recieved the gift since I don't want jailed people to be able to recive gifts. Also is this compatable with multiinventory's?
     
  28. Offline

    gustebeast

    Just some help for updating to 1.2.4, I got this error when I typed in /referredby (name of player not online). It worked if that person was online, but it wouldn't log anything to the file. In the error it says i'm running 0.3, but i assure you I was running 0.4 (the config and commands corresponded to that version)
    Code:
    2012-03-23 07:04:26 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'referredby' in plugin ReferGift v0.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:473)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:826)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:786)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:769)
        at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:115)
        at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.NullPointerException
        at us.topgear93.refergift.ReferGift.onCommand(ReferGift.java:107)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 12 more
     
  29. Offline

    jorisk322

    Could you add the option to let it execute a command when someone refers someone? Like /rank [player] rank, to rank up the player.
     
  30. Offline

    robot56

    Yes! I was looking for a plugin like this I'm putting it on my server.
     

Share This Page