GunZ - Donator Script

Results 1 to 3 of 3
  1. #1
    Apprentice Davile is offline
    MemberRank
    Jan 2010 Join Date
    13Posts

    GunZ - Donator Script

    Hello everyone.
    As you can see i'm looking for a Script that ppl can buy and that change their grade automatically.
    an Example there: http://gunz.herogamers.net/index.php?do=buycolor


  2. #2
    Proficient Member Zinoxity is offline
    MemberRank
    Dec 2009 Join Date
    198Posts

    Re: GunZ - Donator Script

    Quote Originally Posted by Davile View Post
    Hello everyone.
    As you can see i'm looking for a Script that ppl can buy and that change their grade automatically.
    an Example there: http://gunz.herogamers.net/index.php?do=buycolor
    Well, the "script" has been released in a lot of webs.

    I find it easier to create my own.

    Method:

    Check the to see if the UserID logged in has enough coins (Set up in the database)

    Example: SELECT Coins From COINS WHERE UserID = @UserID
    then in php, I think it would be something like:
    if($query < amount){
    echo("You don't have enough");
    }
    else
    {
    echo("Item purchased");
    }

    I don't really use PHP, and my PHP is rough, so, you need to tweak it. Also, make a Table in your database, and name it COINS, add A colum named Coins, and another UserID, also, have the registration page insert into the COINS table, it's quite easy.

  3. #3
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: GunZ - Donator Script

    PHP Code:
    <?php

    $preco 
    5000// Change color price

    $aid $_SESSION['AID']; // AID logged

    $login mssql_fetch_array(mssql_query("SELECT Cash FROM Login(nolock) WHERE AID = $aid"));

    $cash $login['Cash'] - $preco// Coins left

    if( isset($_POST['coloredname']) )
    {
        
    $cor $_POST['cor'];
        
    $coresvalidas = array('10''11''12''13''14'); // Valids Grades

        
    switch($cor)
        {
            case 
    1:
            return 
    $corq 10;
            break;
            case 
    2:
            return 
    $corq 11;
            break;
            case 
    3:
            return 
    $corq 12;
            break;
            case 
    4:
            return 
    $corq 13;
            break;
            case 
    5:
            return 
    $corq 14;
            break;
        }
        
            if(!
    in_array($corq$coresvalidas))
        {
            die(
    "Invalid Color");
        }
        else
        {
            
    mssql_query("UPDATE Account SET UGradeID = $corq WHERE AID = $aid");
            
    mssql_query("UPDATE Login SET Cash = $cash WHERE AID = $aid");
            die(
    "Color buyed succesfuly");
        }
    }

    ?>

    <form method="post" action="index.php?do=buycolor">
    <select name="cor">
    <option selected>Selecione</option>
    <option value="1">Azul</option>
    <option value="2">Verde</option>
    <option value="3">Amarelo</option>
    <option value="4">Rosa</option>
    <option value="5">Vermelho</option>
    </select> 

    <? if($cash >= 0)
    {
        echo 
    '<input type="submit" name="coloredname" value="Comprar Colored">';
    }
    else
    {
        echo 
    'You don\'t have needed coins';
    }

    ?>
    </form>
    Last edited by alfredao; 09-02-10 at 03:47 PM.



Advertisement