TBH, you are better off just building from whats above. This way you can easilly design the system to be what you want it to be. Is it for a mafia type game? If so, then def yes to the above.
Heres my code if you want to look at a finished one (thats messy, and first version that works, wouldn't want you having my finished code! lol)
mysql_select_db($database_london, $london);
$query_Recordset1 = sprintf("SELECT * FROM users WHERE username = '%s'", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $london) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$result = "";
$mon = "";
$crimeFormAction = $_SERVER['PHP_SELF'];
$p_exp = $row_Recordset1['exp'];
$MM_Pid = $row_Recordset1['pid'];
$next_c = $row_Recordset1['time_c'];
if (isset($_POST['crime'])) {
$action=$_POST['crime'];
// their experience
switch($action) {
case "1":
$lvl = 50;
$mon = 500;
break;
case "2":
$lvl = 40;
$mon = 400;
break;
case "3":
$lvl = 30;
$mon = 250;
break;
case "4":
$lvl = 20;
$mon = 100;
break;
case "5":
$lvl = 10;
$mon = 50;
break;
case "6":
$lvl = 5;
$mon = 5;
break;
}
// Now see if they were succesfull
if($p_exp < $lvl) {
srand(time());
$luck = rand(0,10);
srand(time());
$cm = rand(1,$mon);
$mon = $cm;
if($luck <= 7) {
$mon = "";
$result = 'You failed the crime ';// They failed
$fut = time() + 150;
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET time_c = '$fut' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
if($luck < 3){
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET jail = '1', time_jail = '$fut', jail_rea = 'Petty Crime' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
$result = 'You failed the crime and got banged up!';
}
$insertGoTo = "scrime_done.php?result=$result&mon=$mon";
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
} else {
$result = 'Success, you made £'; // They succeded
$fut = time() + 150;
$exp = 1;
if($next_c > time()) {
$mon = 0;
$exp = 0;
}
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET cash = cash + '$mon', exp = exp + '$exp', time_c = '$fut' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
$insertGoTo = "scrime_done.php?result=$result&mon=$mon";
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
}
} else {
srand(time());
$cm = rand(1,$mon);
$mon = $cm;
$luck = rand(1,10);
$fut = time() + 150;
$exp = 1;
if($luck > 6){
$result = "That was too fucking easy! You made £";
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET cash = cash + '$cm', exp = exp + '$exp', time_c = '$fut' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
$insertGoTo = "scrime_done.php?result=$result&mon=$mon";
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
} else {
$mon = "";
$result = 'You failed the crime ';// They failed
$fut = time() + 150;
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET time_c = '$fut' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
if($luck < 3){
mysql_select_db($database_london, $london);
$query_money = sprintf("UPDATE users SET jail = '1', time_jail = '$fut', jail_rea = 'Petty Theft' WHERE pid = '$MM_Pid'");
$money = mysql_query($query_money, $london) or die(mysql_error());
$result = 'You failed the crime and got banged up!';
}
$insertGoTo = "scrime_done.php?result=$result&mon=$mon";
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
}
}
}
Hope that might help a little