[ADMN/WEB] CodeChecker v0.2 - Redeemable codes! [1.0.1-R1]

Discussion in 'Inactive/Unsupported Plugins' started by danieldaniel1, Dec 27, 2011.

  1. Offline

    danieldaniel1

    Have you ever wanted to be able to have trusted users, but not let them abuse their abilities?
    Have you ever wanted to be able to make money off of your server, without having to be online all the time to apply the perks.
    Well, then, this is the plugin for you!
    You can use this for anything!
    Want to be able to let someone use a command only a couple of times? Go for it!
    Want to get revenue from one-time commands? Go for it!

    What exactly IS this plugin?
    You can add redeemable codes online (I will explain this later), or in game! You can even make it automated, as it's connected to a database, which can be easily modified anywhere, anytime!

    Current Features:
    * Add Codes In-Game
    * Add Codes Online
    * Item Spawning
    * Time Changing
    * Teleport's
    * Op

    Download this plugin: http://dev.bukkit.org/server-mods/codechecker/

    USAGE:
    To generate a code ingame:
    * /cg <type: 0 for op, 1 for one-time-tp, 2 for one-time time change, 3 for one-time item spawning>

    To use a code:
    * /code <code> <params: for one-time-tp, enter in the username; for time change, enter in the requested time; for item spawning, type in the item ID>

    Changelog:

    Version 0.1:
    * Initial Release

    Version 0.2:
    * Added support for item spawning

    Online Usage:
    DISCLAIMER: I have NOT tested this code! I take NO responsibility for anything that happens while using this code!


    HTML Form:


    HTML:
    [COLOR=rgb(0, 0, 0)][SIZE=13px][FONT=courier new]<form name="input" action="html_form_action.asp" method="get">
    Type (0 for op, 1 for one-time TP, 2 for one-time time change, and 3 for one-time item spawning): <input type="text" name="type" />
    <input type="submit" value="Submit" />
    </form>[/FONT][/SIZE][/COLOR]
    




    PHP Script:
    NOTE: Please replace the "REPLACE" values with the appropriate values!
    PHP:
    <?php
    $host 
    "REPLACE";
    $user "REPLACE";
    $pass "REPLACE";
    $databaseName "REPLACE";
    $tableName "REPLACE";

    if(
    $_POST['type'] != 0)
    {
     if(
    $_POST['type'] != 1)
     {
      if(
    $_POST['type'] != 2)
      {
       if(
    $_POST['type'] != 3)
       {
        die(
    "Invalid type!");
       }
      }
     }
    }
    $type $_POST['type'];
    $random"";
    $length 8;
      
    srand((double)microtime()*1000000);
      
    $char_list "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      
    $char_list .= "abcdefghijklmnopqrstuvwxyz";
      
    $char_list .= "123456789";
      
    // Add the special characters to $char_list if needed

      
    for($i 0$i $length$i++)
      {
         
    $random .= substr($char_list,(rand()%(strlen($char_list))), 1);
      }
    $link mysql_connect($host$user$pass);
    if (!
    $link) {
        die(
    'Could not connect: ' mysql_error());
    }
    mysql_select_db($databaseName$link);
    $result mysql_query("INSERT INTO '$tableName' (code, type) VALUES ('$random', '$type')");
    if(
    $result)
    {
      echo 
    "Your code for type ".$type." is ".$random;
    }
    else
    {
      echo 
    "ERROR!";
    }
    mysql_close($link);

    ?>

    Available Perks and Corresponding Types:

    * OP / 0

    * One-Time Teleport / 1

    * One-Time Change the Time / 2

    * One-Time Item Spawn /3

    I am going to be adding a lot more features very soon. If you have any suggestions, be sure to PM me!

    Here is how your database should look like:
    * Database Name (What you put in the YML file)
    * Table Name (What you put in the YML file)
    * codes (Varchar -- 8 Characters)
    * type (Varchar or Int -- 1 Character)


    Here is how you should format the YML file:
    Table Name: tablename

    Database Name: databasename

    Database Host: databasehost

    Database Username: databaseusername

    Database Password: databasepassword

    A special thanks to ShiftTH (ShiftedPerspective on Bukkit) and warmaster4 for helping me test this plugin!
     
  2. Offline

    NuclearW

    Please modify your thread to fit the release guidelines on the forums.

    Namely, you must fix your category tags, your formatting of your post, and move commands and such to the proper categories.
     
  3. Offline

    danieldaniel1

    I fixed it.
     
  4. Offline

    HotelManager24

    You should tag him so he can keep track like this:

    @NuclearW He fixed it.
     
  5. Offline

    NuclearW

    @danieldaniel1
    It still needs fixing, replace your <<code>> with
    Code:
     blocks, this site uses BBCode on WikiCreole like BukkitDev
     
  6. Offline

    danieldaniel1

    @NuclearW

    Sorry about that, didn't notice! Fixed.
     
  7. Offline

    NuclearW

Share This Page