Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Special request] Voucher codes

Comments in 'Plugin Development' started by codmadnesspro, Nov 16, 2013.

  1. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Is there any one that can make me a voucher code plugin which you enter a code in game and get given something or you get OPED. Also make it so the code can only be used once so no one else can use it.
  2. 99leonchang
    Offline

    99leonchang Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    165
    Plugins:
    2
    Minecraft User:
    99leonchang
    Yes, it's definitely possible
    codmadnesspro likes this.
  3. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Could you make one for me?
  4. 99leonchang
    Offline

    99leonchang Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    165
    Plugins:
    2
    Minecraft User:
    99leonchang
    I could always try
    No promises though
    codmadnesspro likes this.
  5. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Ok thanks
  6. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    Do you want to chose the coupon codes yourself or generate a random code?
    codmadnesspro likes this.
  7. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Emm I want it so you enter the code that you want to be used but when the person has used that code it deletes itself
  8. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    Of course it's possible. I will try it. :)
    codmadnesspro likes this.
  9. 99leonchang
    Offline

    99leonchang Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    165
    Plugins:
    2
    Minecraft User:
    99leonchang
    Yeah, so the codes are randomly generated?
    codmadnesspro likes this.
  10. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Yes
  11. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    To get a random string you could use this function:

    PHP:
    function random_string$length ) {
            
    $chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

            
    $size strlen$chars );
            for( 
    $i 0$i $length$i++ ) {
                
    $str .= $charsrand0$size ) ];
            }

            return 
    $str;

            }
    to get the string, use

    PHP:
    $code random_string10 );
    Instead of 10, you can use your desired number/lengh.
    codmadnesspro likes this.
  12. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    I know, the plugin is almost finished
    codmadnesspro likes this.
  13. SuperChipsLP
    Offline

    SuperChipsLP Active Member Plugin Developer

    Joined:
    Sep 15, 2013
    Posts:
    204
    Plugins:
    5
    Minecraft User:
    Redmol
    Are you making it? :D
    codmadnesspro likes this.
  14. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    codmadnesspro likes this.
  15. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Wow thanks il try it after as im changeing things on my dns and vps
  16. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    Do you understand the code or do I need to make documentation for it?
  17. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    I kinda understand it any documentation would help!:)
  18. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    You can create a config with "/coupon create [optional: type]", you can define coupon types in the config file for quick making of the same coupons. For example I want to create a lot of coupons that will op someone, than you can add a coupon-type to the config file with all the default settings for that type. (note that the op type is already added to the config by default). If you make a coupon without setting the type than it will generate a default coupon type. To add commands to a coupon code you need to do the command "/coupon addcommand [ code] [command]" , [ code] needs to be the coupon code but to make it easy you can also use "last" for the last coupon code you created, [command] is the command that you want to add to the coupon code, you can use "--player--" or "--username--" in a command to get the username of the player who uses the coupon. You can add as many commands as you like. When a player uses the coupon code it will execute the commands and send a message to the player that you can customize with "/coupon changemsg [ code] [message]", [ code] can also be "last" for the last coupon code. To remove a coupon you need to use "/coupon remove [ code]" and [ code] can also be "last". If a player who's not op uses the command "/coupon [ code]" it will validate the code and execute the commands.

    I hope this is enough documentation ;)
    iJoshuaHD likes this.
  19. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Ok thanks man!
  20. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    Do you minding me post the plugin on plugin section? I'll give credit

Share This Page

Advertisement