
Cronic
Members-
Posts
60 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Cronic
-
Anyone know how to fix this.. The way it should be is as firefox shows its in this screenshot below. [ATTACH=CONFIG]371[/ATTACH] Now when I open it with Internet Explorer it looks like this: [ATTACH=CONFIG]372[/ATTACH] I just used an easy html tag like this: <hr width="95%" align="center"> Into the stylesheet file: [CSS] hr{ opacity: 0.1; } [/CSS] Like I said in FireFox its the way how it should be, yet Internet Explorer shows something different.
-
Thanks. works now.. :) I've created it like this: header.php <link rel="stylesheet" href="styles/<?php echo $user_class->layout; ?>" type="text/css" /> header.php if(isset($_POST['submit'])){ $theme = $_POST['layout']; $result = mysql_query("UPDATE `grpgusers` SET `layout` = '".$_POST['layout']."' WHERE `id` = '".$user_class->id."'"); echo Message("You have successfully changed your theme."); <div class="menu"> <h3> Change Site Theme</h3> <div class="bg"> <br> <center> <form method="post"> <select name="layout" id="layout"> <option value="main.css">Default Theme</option> <option value="blue.css">Blue Theme</option> <option value="red.css">Red Theme</option> <option value="green.css">Green Theme</option> </select> <input type='submit' name='submit' value='Change Theme'> </form> </div> </div>
-
You're asking price is way too high.
-
Hi there, I'm working on a new function so users can decide between a few game layouts. <?php if ($user_class->bluelayout == 1 ) { ?> <link rel="stylesheet" href="styles/blue.css" type="text/css"> <? } ?> <?php if ($user_class->redlayout == 1){ ?> <link rel="stylesheet" href="styles/red.css" type="text/css"> <? } ?> Im still working on the function that when they change their layout id, it automatically updates in the database too. Just wondering, would this make any sense?
-
Yeah, I am trying to fix it to the Captcha way, but haven't succeeded yet, once its done i'll update the code.
-
Very nice game. Worth playing ;)
-
-
<?php include 'header.php'; $error = ($user_class->jail > 0) ? "You can't do crimes if your in prison!" : $error; $error = ($user_class->hospital > 0) ? "You can't do crimes if your in hospital!" : $error; if (isset($error)){ echo Message($error); include 'footer.php'; die(); } if ($_GET['spend'] == "nerve"){ if($user_class->points >= 10) { if($user_class->nerve == $user_class->maxnerve) { echo Message("Your nerve is already full up!"); } else { $newpoints = $user_class->points - 10; $newnerve = ($user_class->maxnerve > 100) ? $user_class->nerve + 100 : $user_class->maxnerve; $newnerve = ($newnerve > $user_class->maxnerve) ? $user_class->maxnerve : $newnerve; $result = mysql_query("UPDATE `grpgusers` SET `nerve` = '".$newnerve."', `points`='".$newpoints."' WHERE `id`='".$_SESSION['id']."'"); echo Message("You spent 10 points and refilled your nerve."); } } else { echo Message("You don't have enough points to do that."); } } $result = mysql_query("SELECT * FROM `grpgusers` WHERE `id`='".$user_class->id."'"); $worked = mysql_fetch_array($result); $currenthex = $worked['crimehex']; $crime = $_GET['id']; $hex = $_GET['hex']; if ($crime != ""){ if ($hex == $currenthex) { $updatehex = md5(uniqid(rand(), true)); $result = mysql_query("UPDATE `grpgusers` SET `crimehex` = '".$updatehex."' WHERE `id` = '".$user_class->id."'"); $result = mysql_query("SELECT * FROM `crimes` WHERE `id`='".$crime."'"); $worked = mysql_fetch_array($result); $nerve = $worked['nerve']; $time = floor(($nerve - ($nerve * 0.5)) * 6); $name = $worked['name']; $stext = 'You successfully managed to '.$name; $ftext = 'You failed to '.$name; $chance = rand(1,(((25 * $nerve) - $user_class->level)) - round($user_class->awakepercent / 2)); $chance = ($user_class->eqshoes == 73) ? $chance - floor(($chance / 100) * 10) : $chance; $randomize1 = rand(1,30); // get the crimes here $money = (50 * $nerve) + 15 * ($nerve - 1); $exp = (25 * $nerve) + 15 * ($nerve - 1); $rawexp = (25 * $nerve) + 15 * ($nerve - 1); if ($user_class->nerve >= $nerve) { if($randomize1 == 19) { echo Message($ftext.".<br /><br /><a href='crime.php?id=".$crime."&hex=".$updatehex."'>Retry</a> | <a href='crime.php'>Back</a>"); $crimefailed = 1 + $user_class->crimefailed; $nerve = $user_class->nerve - $nerve; $result = mysql_query("UPDATE `grpgusers` SET `crimefailed` = '".$crimefailed."', `nerve` = '".$nerve."' WHERE `id`='".$user_class->id."'"); } else { if($chance <= 75) { echo Message($stext.".<br />You received ".$exp." exp and $".$money.".<br /><br /><a href='crime.php?id=".$crime."&hex=".$updatehex."'>Retry</a> | <a href='crime.php'>Back</a>"); $exp = $exp + $user_class->exp; $crimesucceeded = 1 + $user_class->crimesucceeded; $crimemoney = $money + $user_class->crimemoney; $money = $money + $user_class->money; $nerve = $user_class->nerve - $nerve; $todaysexp = $user_class->todaysexp + $rawexp; $expcount = $user_class->expcount + $rawexp; $result = mysql_query("UPDATE `grpgusers` SET `exp` = '".$exp."', `crimesucceeded` = '".$crimesucceeded."', `crimemoney` = '".$crimemoney."', `money` = '".$money."', `nerve` = '".$nerve."', `todaysexp` = '".$todaysexp."', `expcount` = '".$expcount."' WHERE `id`='".$_SESSION['id']."'"); }elseif ($chance >= 250) { echo Message($ftext.".<br />You were hauled off to prison for " . $time . " minutes.<br /><br /><a href='crime.php?id=".$crime."&hex=".$updatehex."'>Retry</a> | <a href='crime.php'>Back</a>"); $crimefailed = 1 + $user_class->crimefailed; $jail = time() + ($time * 60); $nerve = $user_class->nerve - $nerve; $caught = $user_class->caught + 1; $result = mysql_query("UPDATE `grpgusers` SET `crimefailed` = '".$crimefailed."', `caught` = '".$caught."', `jail` = '".$jail."', `nerve` = '".$nerve."' WHERE `id`='".$_SESSION['id']."'"); }else{ echo Message($ftext.".<br /><br /><a href='crime.php?id=".$crime."&hex=".$updatehex."'>Retry</a> | <a href='crime.php'>Back</a>"); $crimefailed = 1 + $user_class->crimefailed; $nerve = $user_class->nerve - $nerve; $result = mysql_query("UPDATE `grpgusers` SET `crimefailed` = '".$crimefailed."', `nerve` = '".$nerve."' WHERE `id`='".$_SESSION['id']."'"); } } } else { echo Message("You don't have enough nerve for that crime.<br /><br /><a href='crime.php'>Go Back</a>"); } include 'footer.php'; die(); } else { echo Message("The page you requested has timed out. This may have been caused by refreshing the page or following an incorrect link.<br /><br /><a href='crime.php'>Go Back</a>"); include 'footer.php'; die(); } } ?> <div id="right_c"><div class="g_content"><h3> Crime</h3><div class="g_text"> <table width='100%'> <tr> <td><center><a href='crime.php?spend=nerve'>Refill Nerve</a></center></td> </tr></table> <table width='100%'> <tr> <td width='50%'><b>Name</b></td> <td width='25%'><b>Nerve</b></td> <td width='25%'><b>Action</b></td> </tr> <? $newhex = md5(uniqid(rand(), true)); $result = mysql_query("UPDATE `grpgusers` SET `crimehex` = '".$newhex."' WHERE `id` = '".$user_class->id."'"); $result = mysql_query("SELECT * FROM `crimes` ORDER BY `nerve` ASC"); while($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<tr><table width='100%'><td width='50%'>".$line['name']."</td><td width='25%'>".$line['nerve']."</td><td width='25%'>[<a href='crime.php?id=".$line['id']."&hex=".$newhex."'>do</a>]</td></tr></table>"; } ?> </table> </div> </div> </div> </td></tr> <?php include 'footer.php'; ?>
-
Thank you Lithium, That worked. Much appreciated. :cool:
-
-
Function to add it to the database. function DailyGameLog($id, $text, $extra="0") { $time = time(); $text = addslashes($text); $result = mysql_query("INSERT INTO `dailygameevents` (`player`, `text`, `timestamp`, `extra`) VALUES ('".$id."', '".$text."', '".$time."', '".$extra."')"); } Tried to make a log for when people level: Send_Event ($this->id, "You have just gained a level.", $this->id); DailyGameLog($user_class->id, "[-_USERID_-] has gained a level."); @ php my admin logid player text timestamp extra 1 1 [-_USERID_-] has gained a level. 1334868546 0
-
Catchable fatal error: Object of class User could not be converted to string in /home/u982643937/public_html/MafiaHeros Engine/city.php on line 140 line 135 t/m 147 $result = mysql_query("SELECT * FROM `dailygameevents` ORDER BY `timestamp` DESC LIMIT $offset, $rowsperpage"); if(mysql_num_rows($result) > 0) { while($line = mysql_fetch_array($result)) { $player = new User($line['player']); $text = str_replace("[-_USERID_-]", $player->formattedname, $line['text']); echo "<tr><td style='border-right: 1px solid #444444; border-bottom: 1px solid #444444;' width='82%'>".$player."</td><td style='border-right: 1px solid #444444; border-bottom: 1px solid #444444;' width='18%'>".date(d." ".F." ".Y.", ".g.":".ia,$line['timestamp'])."</td></tr>"; } echo "</table>"; } else { echo "</table>"; echo "<br /><center>No game events have occurred today.</center>"; } echo "<br />"; Anyone know what i'm doing wrong? I really don't see the problem. :(
-
-
What i'm doing wrong? <div id="right_c"><div class="g_content"><h3> Mobsters Online</h3><div class="g_text"> <? echo '<center><p>Users Online In The Last 15 Minutes</p></center>'; $result = mysql_query("SELECT * FROM `grpgusers` ORDER BY `lastactive` DESC"); echo '<table width="100%">'; echo '<tr>'; echo '<td><b>Username</b></td>'; echo '<td><b>Active</b></td>'; echo '</tr>'; if ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $secondsago = time()-$line['lastactive']; if ($secondsago<=900) { $user_online = new User($line['id']); echo "<center><tr><td>".$user_online->formattedname."</td><td>".howlongago($user_online->lastactive)."</td></center>"; } } echo '</table>'; echo '</td></tr>'; ?> </div> </div> </div> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Webhosting\xampp\htdocs\Cronic Engine\home.php on line 23 I'm trying to list the Mobsters online at the Home page. I am running it on my localhost server, mySQL database is connected, yet it doesn't work. :(
-
Hmm ok. so it would be better to make it like: if(isset($_POST['sumbit'])){ $username = $_POST["username"]; $username = mysql_real_escape_string($username); $password = $_POST["password"]; $password = myql_real_escaoe_string($password); Thanks for the help by the way. :)
-
Dreamweaver rules :)
-
Hmm, okay thanks. I will give it a try, trying to get rid of all the bugs/glitches in the GRPG Source.
-
Is my Login script secured now? <? include 'nliheader.php'; if(isset($_POST['submit'])){ $username = $_POST["username"]; $username = addslashes($username); $password = $_POST["password"]; $password = addslashes($password); $result = mysql_query("SELECT * FROM `grpgusers` WHERE `loginame`='$username'") or die (Message("Sorry, your username and password combination are invalid.")); $worked = mysql_fetch_array($result); $ban1 = mysql_query("SELECT * FROM `bans` WHERE `id` = '".$worked['id']."' AND (`type` = 'freeze' OR `type` = 'perm')"); $ban = mysql_num_rows($ban1); if ($_SESSION['AntiSpamImage'] !== $_REQUEST['anti_spam_code']) { // set antispam string to something random, in order to avoid reusing it once again $_SESSION['AntiSpamImage'] = rand(1,9999999); echo Message('<div>The verification code you entered is invalid.</div>'); } else { if($worked['password'] == $password) { if ($worked['activate'] != "0") { echo Message(' Your account has not yet been activated. If you have lost the email you can have it send again by clicking <a href="sendactivate.php">here</a>.'); include('nlifooter.php'); die(); } if($worked['ban/freeze'] == 1 || $ban > 0) { echo Message(' Your account has either been banned or frozen. Please check back in a few days to see if it has been lifted.'); include('nlifooter.php'); die(); } echo Message('Please wait, you are being logged in. Do not press the back button.<br />If you still see this page after 10 seconds you may want to try re-logging in.'); echo '<meta http-equiv="refresh" content="1;url=index.php">'; $_SESSION["id"] = $worked['id']; include('nlifooter.php'); die(); } else { echo Message('Sorry, your username and password combination are invalid.'); } } } ?> <div id="right_c"><div class="g_content"><h3> Login</h3></div><div class="g_text"> <form name='login' method='post' action='login.php'> <table width='60%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td width='35%' height='27'><font size='2' face='verdana'>Username: </font></td> <td width='65%'><font size='2' face='verdana'> <input name='username' type='text' size='22' value="<?php echo md5($_POST['username']); ?>"> </font></td> </tr> <tr> <td height='24'><font size='2' face='verdana'>Password </font></td> <td><font size='2' face='verdana'> <input name='password' type='password' size='22' value="<?php echo md5($_POST['password']); ?>"> </font></td> <tr> <td><font size='2' face='verdana'> <br /> <input type='submit' name='submit' value='Login'> </font></td> </tr> </tr> </table> </form> </div> </div> <? include 'footer.php'; ?>
-
Got any examples?
-
Gotta say you've got a nice game!
-
Updated a few codes and changed design. Domain will come with time when everything is coded nicely and working.