Results 1 to 9 of 9

Thread: Game thing..

  1. #1
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Game thing..

    could you guys help me make a simple one of these:

    jail system
    crime system

    thanks..(for a game btw)

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    This might be the least descriptive post I've seen.

  3. #3
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    =[
    i suck

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    what is a jail system and crime system as a game?

  5. #5
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    like im making a game
    and i dont know how to code this bit

    i coded the login, register , profile
    so far and i need the jail

    the jail wouldnt do the user do anything until hes let out and the jail page would have the time left for him to get out, and the crime is basically for the user doing crimes, gaining money, -energy


    thanks again

  6. #6
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    How does one refrain from laughing when reading this thread?

    jail.php
    PHP Code:
    <?php 

    @mysql_connect("localhost",$user,$pass);
    @
    mysql_select_db($db);

    $criminal $_COOKIE[criminal];
    $sheriff $_COOKIE[sheriff];
    $day date("m/d/Y");

    if(isset(
    $sheriff)) {
    } else {
    ?>
    Wah howdy, partner!<br>
    These folks been doin' crimes round these parts.
    <table align="center" border="1">
    <tr>
    <th>Criminal</th>
    <th>Day Released</th>
    <th>Crime</th>
    </tr>
    <?php
    $criminals 
    mysql_query("SELECT * FROM jail") or die(mysql_error());

    while(
    $c mysql_fetch_array$criminals )) {
    ?>
    <tr>
    <td><?php echo $c[criminal]; ?></td>
    <td><?php echo $c[releaseDay]; ?></td>
    <td><?php echo $c[crime]; ?></td>
    </tr>
    <?php

    $crime 
    mysql_query("SELECT * FROM jail WHERE criminal='$criminal'") or die(mysql_error());

    while(
    $c mysql_fetch_array$crime )) {

    if(
    $c[releaseDay] > $date) {
    echo 
    '<h1>You\'re released from jail!</h1>';
    } else {
    ?>
    <p align="center">
    You've been arrested for <b><?php echo $c[crime]; ?></b><br>
    You're released on <b><?php echo $c[releaseDay]; ?></b><br>
    </p>
    <?php
    }
    }
    }

    ?>
    mysql_dumb.sql
    Code:
    CREATE TABLE `test`.`jail` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `criminal` VARCHAR( 255 ) NOT NULL ,
    `crime` VARCHAR( 255 ) NOT NULL ,
    `releaseDay` VARCHAR( 255 ) NOT NULL ,
    PRIMARY KEY ( `id` ) 
    ) ENGINE = InnoDB
    - Josh

  7. #7
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, but i get this


    Parse error: parse error in C:\xampp\htdocs\jail.php on line 49

    line 49 is ?>

  8. #8
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I thinks it's missing one of these }. Try this:

    PHP Code:
    <?php 

    @mysql_connect("localhost",$user,$pass);
    @
    mysql_select_db($db);

    $criminal $_COOKIE[criminal];
    $sheriff $_COOKIE[sheriff];
    $day date("m/d/Y");

    if(isset(
    $sheriff)) {
        } else {
        
    ?>
        Wah howdy, partner!<br>
        These folks been doin' crimes round these parts.
        <table align="center" border="1">
        <tr>
        <th>Criminal</th>
        <th>Day Released</th>
        <th>Crime</th>
        </tr>
        <?php
        $criminals 
    mysql_query("SELECT * FROM jail") or die(mysql_error());
            while(
    $c mysql_fetch_array$criminals )) {
            
    ?>
            <tr>
            <td><?php echo $c[criminal]; ?></td>
            <td><?php echo $c[releaseDay]; ?></td>
            <td><?php echo $c[crime]; ?></td>
            </tr>
            <?php
            $crime 
    mysql_query("SELECT * FROM jail WHERE criminal='$criminal'") or die(mysql_error());
                while(
    $c mysql_fetch_array$crime )) {
                    if(
    $c[releaseDay] > $date) {
                        echo 
    '<h1>You\'re released from jail!</h1>';
                    } else {
                    
    ?>
                    <p align="center">
                    You've been arrested for <b><?php echo $c[crime]; ?></b><br>
                    You're released on <b><?php echo $c[releaseDay]; ?></b><br>
                    </p>
                    <?php
                    
    }
                }
            }
        }
    ?>

  9. #9
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    woooo, ur cool

    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •