Log in

View Full Version : Game thing..



Rdogg
08-04-2009, 12:27 AM
could you guys help me make a simple one of these:

jail system
crime system

thanks..(for a game btw)

bluewalrus
08-04-2009, 02:11 AM
This might be the least descriptive post I've seen.

Rdogg
08-04-2009, 02:19 AM
=[
i suck

bluewalrus
08-04-2009, 02:52 AM
what is a jail system and crime system as a game?

Rdogg
08-04-2009, 03:04 AM
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

JShor
08-04-2009, 05:01 PM
How does one refrain from laughing when reading this thread? :D

jail.php


<?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


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

Rdogg
08-04-2009, 09:25 PM
thanks, but i get this


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

line 49 is ?>

bluewalrus
08-04-2009, 11:49 PM
I thinks it's missing one of these }. Try this:


<?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
}
}
}
}
?>

Rdogg
08-05-2009, 12:33 AM
woooo, ur cool :)

thanks