Buy commands plugin request

Discussion in 'Archived: Plugin Requests' started by Jacobypvp, Oct 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Jacobypvp

    I would like a plugin where a player can type /buycmd and then the node for it. For example im running a spells server and i want players to be able to buy spells so if they wanted buy the spell accio they would type /buycmd accio. Some how the server would have to notice that
     
  2. Offline

    Tecno_Wizard

    I can probably get this but it will not be within the next week because I'm crazy busy, but if it comes down to it my friend that I am teaching and I could do it.
    I do not work with my own currencies so it would be Vault hard-dependent if that's acceptable.

    EDIT: I did look for alternatives to this and none of them seem to work anymore. I'll do it, but if someone has a faster time frame please do not hesitate to take it.
     
  3. Offline

    Jacobypvp

    Thank you for the quick reply and yeah vault is perfectly fine! Also I'm quite interested in bukkit coding myself and was wondering if you could skype call me for a quick java lesson thanks in advance!
     
  4. Offline

    Tecno_Wizard

    I do not skype people I do not know, but I would be willing to send you some links to videos that I know are very good. Do you know any Java at all?
    Also, I will likely get to work on this on Saturday. Five hours of homework a night keeps me tied down.
    Note to you: ATM curse is not accepting plugins due to a vulnerability found that could let programs that hack severs slip past them. Until that is resolved, I will not be able to post the plugin.

    EDIT: I have decided that I will create the basic version for you ASAP, but I plan on elaborating on this to make it a full-blown configurable plugin.
     
    Jacobypvp likes this.
  5. Offline

    timtower Administrator Administrator Moderator

    Tecno_Wizard Dropbox links on here are always allowed, they won't get checked by Curse, they have always been at your own risk
     
  6. Offline

    Jacobypvp

    Tecno_Wizard Tecno_Wizard
    Please send me the plugin via dropbox if curse isn't allowing anymore submissions.
    https://www.dropbox.com/ I know little to nothing about java. I have dev kit and eclipse installed along with java 7
     
  7. Offline

    Tecno_Wizard

    bwfcwalshy, yea, a bukkit dev made a scanner that searches for the piece of code that was malicious.
    Also, Jacobypvp, google the new boston and watch his java videos.

    The diagram is also finished.
    CMDS:
    /buycmd <command name>- initiates the purchase command process
    /cmdshop- sends list of commands to buy and prices
    /confirm- confirms purchase
    /deny- denies purchase
    /updateconfig - refreshes config file to add settings for listed cmds

    ////////////////////////////////////////////////////////////////////
    CONFIG:
    lists of cmds at top, creates section for each with cmd /updateconfig
    name: ''
    price: 0
    true_command_name: ''
    //TO ADD LATER- permission node to be able to purchase
    //TO ADD LATER- some system of getting sale times
    //TO ADD LATER- sale price

    //////////////////////////////////////////////////////////////////////
    SAVE:
    each player UUID that has purchased a cmd
    list of purchased cmds

    //////////////////////////////////////////////////////////////////////
    CMD ACTIONS:
    if purchase possible, "CHATCOLOR.ORANGE + "Do you want to buy the command " + CHATCOLOR.GOLD + main.getConfig.getString() + CHATCOLOR.ORANGE
    + " for " + CHATCOLOR.GOLD + main.getConfig.getDouble() + CHATCOLOR.ORANGE + currencyplural + "?" + CHATCOLOR.ORANGE + "\n/confirm or /cancel"
    then save in array list with to be confirmed UUIDs

    if cmd /confirm is entered while arraylist contains player and has enough money, add to save list with the true_command_name
    send message CHATCOLOR.GREEN + "You purchased " + CHATCOLOR.GOLD + cmdname + CHATCOLOR.GREEN " for " + CHATCOLOR.GOLD playermoney + currencynameplural + "!"
    else if not enough money
    send message CHATCOLOR.RED + "You do not have enough " + currencynameplural
    else if not in array list + CHATCOLOR.RED + "You are not trying to purchase any command."

    if cmd /deny is entered
    if in arraylist
    send message CHATCOLOR.BLUE + "Purchase cancelled."
    else
    send message CHATCOLOR.RED + "You are not trying to purchase any command."

    //TO ADD LATER- first check to see if player can even purchase the command

    //////////////////////////////////////////////////////////////////////
    CMD PREPROCESS:
    get the command name trying to be executed
    check to see if the command specified needs to be bought to use (console's, OPS and moderators are exempt, will return false)
    if true, check to see if the player trying to execute the code has bought it
    if bought, run command
    if not bought, cancel command with message "ChatColor.RED + "You have not purchased" + cmd.getName
    + ". Use " + CHATCOLOR.GOLD + " \buycmd " + commandname + CHATCOLOR.RED + "\nUse" + CHATCOLOR.RED to purchase the command for " CHATCOLOR.GOLD + main.getConfig.getDouble())/must check config for errors before hand
     
  8. Offline

    Tecno_Wizard

    Jacobypvp, i apoligize for the amount of time this is taking. I ran into some unexpected issues today with the save file that I will have to resolve another time, so the config will also be the save of the first version. It also seems that all alises will have to be stated seperately, for I cannot just fetch them it seems. Buying one alis will still purchase all of the alises though.
     
  9. Offline

    Syd

  10. Offline

    Tecno_Wizard

    Syd, I got a 404 trying to open that link...
     
  11. Offline

    Syd

  12. Offline

    luiskeniosis

    Oh hey jacoby xD
     
    Jacobypvp likes this.
  13. Offline

    Tecno_Wizard

    Syd, I plan on adding more to this than you currently have. Plus, no dependencies other than Vault.
    Jacobypvp, It looks like vs. 1.0 will be finished by next week at the latest.
     
    Jacobypvp likes this.
  14. Offline

    Jacobypvp

    It's ok take your time!

    So i can type /buycommand /help and it will give it to me or is it. /buycommand essentials.help ?

    The whole point of this is that i want it so players can buy these spells http://harrypotterspells.tk/spells.html using nodes if i wanted to be the accido spell i would type /buycommand harrypotterspells.spell.avis

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

    Tecno_Wizard

    Since you can't technically have more than one command with the same name (Unless they are subcommands), it would just be /buycmd accido or /buycmd avis, After that, you confirm the purchase with /confirm or /deny. Prices will be set in an auto-generating config by adding the name to the list. To save processing power, all alises will also have to be stated in the config as their own section, but buying one alis buys them all. Purchases by permissions and subcommands will also be added soon, but it won't be the first version.
     
    Jacobypvp likes this.
  16. Offline

    Jacobypvp

    Thanks a ton I can't wait to try it out!
     
  17. Offline

    Tecno_Wizard

    Jacobypvp, so being the idiot I can be, I realized that the config was WAY too confusing. Because of that, I will be rebuilding it to make more sense and be creating a PDF file on how to use it (Yes, because of aliases, it's that bad).
    Also, I do not have any connections to test this on a large scale, so any glitches that would result from large scale use I will not be able to find. Once I get this config working, I should be in the home streach. Sorry this is taking so long. As a high school student, I do have a life.

    EDIT: HAHA! Wow that was a stupid mistake. I was accidently resetting the aliases area. CommandsForSale Version 1.0 is operational and in the debugging stage!
     
  18. Offline

    Tecno_Wizard

Thread Status:
Not open for further replies.

Share This Page