Jump to content
MakeWebGames

SMOKEY_TEK

Members
  • Posts

    126
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SMOKEY_TEK

  1. I really do appreciate this runthis.... Cheers dude...
  2. That's the problem, I don't really understand what their saying, lol..
  3. I found this site that has something really cool.. I'm gonna try and code that in to work with my game.. lawls.. http://www.cssplay.co.uk/mozilla/splittext.html
  4. I appreciate your help Grant, but I somehow managed to get it working now, lawls...
  5. Does anyone know how I would go about getting players names like below: SMOKEY_TEK I see some games have this feature, and I'm really not sure on how to do it other than making the username in phpmyadmin TEXT and doing it that way.
  6. Okay let's say my job was ID: 5 .   $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id` = '".$updates_user->job."'");   And let's say ".$updates_user->job." is 5 . So the `id` is the job id's not the users ... So it is looking in the jobs table for ID 5 to get that information...
  7. That is getting the pay amount from that job that the player has, shouldn't be anything wrong with it..
  8. SMOKEY_TEK

    Crons

    For some odd reason my cron jobs aren't working, I thought I had set it up right but I guess I didn't. Could someone please help me to get this working... Here is the file that I am trying to have updated.. File called update.php <?php include (DIRNAME(__FILE__) . '/dbcon.php'); include (DIRNAME(__FILE__) . '/classes.php'); if ($_GET['update'] != "569864") { echo " <html> <head> <link rel='stylesheet' type='text/css' href='http://www.hitmanmassacre.com/style.css' media='all' /> </head> <body> <div class='wrapper'> <div class='header'> <img src='http://www.hitmanmassacre.com/images/2a4zfqo.jpg' alt='Hitman Massacre' title='Hitman Massacre' /> </div><!-- end .header --> <div class='left'> <h3>Menu:</h3> <ul> <li><a href='index.php'>Home</a></li> <li><a href='login.php'>Login</a></li> <li><a href='register.php'>Register</a></li> <li><a href='forgotpassword.php'>Forgot Password</a></li> <li><a href='screenshots.php'>Screenshots</a></li> <li><a href='contactus.php'>Contact Us</a></li> </ul> </div><!-- end .left --> <div class='content'> <h3>Hitman Massacre - Error</h3> <p align='center'>Your not authorized to be in here.</p> </div></div> </body></html>"; die(); } else { $result2 = mysql_query("DELETE FROM `spylog` WHERE `spyAge` < ".time() - 172800);// clear out old spy log stuff $result = mysql_query("SELECT * FROM `users`"); while($line = mysql_fetch_assoc($result)) { $updates_user = new User($line['id']); $newmoney = $updates_user->money; $username = $updates_user->username; $new_contracted = $updates_user->contracted - 1; $new_contracted = ($new_contracted < 0) ? 0 : $new_contracted; if($newcontracted > 1) { $interest = .04; } else { $interest = .02; } $mailban = $updates_user->mailban - 1; $new_mailban = ($new_mailban < 0) ? 0 : $new_mailban; $frozen = $updates_user->frozen - 1; $new_frozen = ($new_frozen < 0) ? 0 : $new_frozen; $banned = $updates_user->banned - 1; $new_banned = ($new_banned < 0) ? 0 : $new_banned; $forumban = $updates_user->forumban - 1; $new_forumban = ($new_forumban < 0) ? 0 : $new_forumban; $newbank = ceil($updates_user->bank + ($updates_user->bank * $interest)); if($updates_user->job != 0){ $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'"); $worked_job = mysql_fetch_array($result_job); $new_money = $new_money + $worked_job['money']; } $result_2 = mysql_query(" UPDATE `users` SET `money` = '".$new_money."', `mailban` = '".$new_mailban."', `forumban` = '".$new_forumban."', `banned` = '".$new_banned."', `frozen` = '".$new_frozen."', `contracted` = '".$new_contracted."', `bank` = '".$newbank."', `searchdowntown` = '100', `dailyReward` = '1', `luckyDip` = '1' `daysold` = `daysold`+1 WHERE `username` = '".$username."'"); } } ?>
  9. This is what I use.. Save file as CaptchaSecurityImages.php Also, you will need monofont.tff to work... <?php session_start(); class CaptchaSecurityImages { var $font = 'monofont.ttf'; function generateCode($characters) { /* list all possible characters, similar looking characters and vowels have been removed */ $possible = '23456789bcdfghjkmnpqrstvwxyz'; $code = ''; $i = 0; while ($i < $characters) { $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; } return $code; } function CaptchaSecurityImages($width='120',$height='40',$characters='6') { $code = $this->generateCode($characters); /* font size will be 75% of the image height */ $font_size = $height * 0.75; $image = imagecreate($width, $height) or die('Cannot initialize new GD image stream'); /* set the colours */ $background_color = imagecolorallocate($image, 255, 255, 255); $text_color = imagecolorallocate($image, 20, 40, 100); $noise_color = imagecolorallocate($image, 100, 120, 180); /* generate random dots in background */ for( $i=0; $i<($width*$height)/3; $i++ ) { imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color); } /* generate random lines in background */ for( $i=0; $i<($width*$height)/150; $i++ ) { imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color); } /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function'); /* output captcha image to browser */ header('Content-Type: image/jpeg'); imagejpeg($image); imagedestroy($image); $_SESSION['security_code'] = $code; } } $width = isset($_GET['width']) && $_GET['width'] < 600 ? $_GET['width'] : '120'; $height = isset($_GET['height']) && $_GET['height'] < 200 ? $_GET['height'] : '40'; $characters = isset($_GET['characters']) && $_GET['characters'] > 2 ? $_GET['characters'] : '6'; $captcha = new CaptchaSecurityImages($width,$height,$characters); ?>   Where you want to use or see the Captcha insert this:   <img src='CaptchaSecurityImages.php' width='120' height='40'>   After this part: $checkuser = mysql_query("SELECT * FROM `users` WHERE `login_name` OR `username` ='$registerLoginName'"); $username_exist = mysql_num_rows($checkuser); if($username_exist > 0) { $message .= "The Login Name you entered is already in use. <br>"; } Include code below: if(!$_POST['registerCaptcha']) { $message .= "You must enter the Verification Code correctly. <br>"; }   I apologize for my bad instructions... Hope you can figure them out..
  10. Thanks for the help, I still couldn't figure out what was going on so I just got a new Grpg script and did it like that and it's working ...
  11. The only pages I changed was my register, login, activate, forgotpassword... And I don't see anything including header. This is starting to get annoying. Grrr!   So how do I do this   grep -ril header.php *
  12. This is what is on line 14 }   function microtime_float() { $time = microtime(); return (double)substr( $time, 11 ) + (double)substr( $time, 0, 8 ); } microtime_float(); $starttime = microtime_float();
  13. I need someone to help me PLEASE ...........
  14. Since I currently didn't use a database, you would have to create a database for the chat and whenever a user goes into that it would update or insert into the chat database and add code to pull those users in chat and so on.
  15. I log in and I get this error for some odd reason.   Fatal error: Cannot redeclare microtime_float() (previously declared in /home/hitmanm1/public_html/header.php:12) in /home/hitmanm1/public_html/header.php on line 14   If anyone can help me with this much appreciated, I have no idea what I did to get this error.
  16. I'm gonna work on coding this layout... I'll post back when I complete this... I will be starting it sometime tonight though, as I have to goto work here shortly and have to do some stuff when I get off. Was a home page, login, register and etc been created?
  17. When will someone code for a layout? I really really like this template... lol
  18. I like this, but I don't understand why you would ban a user from their profile.
  19. Very much professional that you can't reply back regarding my PM I sent you phpcoder56. I'm interested in some mods of yours, well was interested, but since you don't wanna bother replying back I'll say SCREW IT!
  20. Really? I didn't think Playstation Network was online. A mate said it wouldn't be back online in like three days.
  21. lawls, thanks ... ;)
  22. Save this as chatroom.php <? session_start(); include (DIRNAME(__FILE__) . '/header.php'); if(isset($_GET['logout'])){ //Simple exit message $fp = fopen("log.html", 'a'); fwrite($fp, "<div class='msgln'>(".date("g:i A").") [i]". $_SESSION['name'] ." has left the chat.[/i] </div>"); fclose($fp); session_destroy(); header("Location: home.php"); //Redirect the user } $_SESSION['name'] = $user_class->formattedname; ?> <div class="content"> <h3>Chat</h3> <div id="menu"> <p class="welcome" align="center">Welcome To The Chatroom, [b]<?php echo $_SESSION['name']; ?>[/b]</p> <p class="logout" align="center">[url="home.php"]Exit Chat[/url]</p> </div> <div id="chatbox"><?php if(file_exists("log.html") && filesize("log.html") > 0){ $handle = fopen("log.html", "r"); $contents = fread($handle, filesize("log.html")); fclose($handle); echo $contents; } ?></div> <form name="message" action=""> <p align="center"> <input name="usermsg" type="text" id="usermsg" size="63" /> <input name="submitmsg" type="submit" id="submitmsg" value="Send" /> </p> </form> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> // jQuery Document $(document).ready(function(){ //If user submits the form $("#submitmsg").click(function(){ var clientmsg = $("#usermsg").val(); $.post("post.php", {text: clientmsg}); $("#usermsg").attr("value", ""); return false; }); //Load the file containing the chat log function loadLog(){ var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20; $.ajax({ url: "log.html", cache: false, success: function(html){ $("#chatbox").html(html); //Insert chat log into the #chatbox div var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20; if(newscrollHeight > oldscrollHeight){ $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div } }, }); } setInterval (loadLog, 2500); //Reload file every 2.5 seconds //If user wants to end session $("#exit").click(function(){ var exit = confirm("Are you sure you want to end the session?"); if(exit==true){window.location = 'chatroom.php?logout=true';} }); }); </script> </div> </body> </html> Of course you will have to change <h4></h4> <div class="content"></div> to whatever your stuff is like.. Save file as post.php <? session_start(); if(isset($_SESSION['name'])){ $text = $_POST['text']; $fp = fopen("log.html", 'a'); fwrite($fp, "<div class='msgln'>(".date("g:i A").") [b]".$_SESSION['name']."[/b]: ".stripslashes(htmlspecialchars($text))." </div>"); fclose($fp); } ?> Add this css to your existing css #chatbox { text-align:left; margin:0 auto; margin-bottom:25px; padding:10px; background:#000; height:270px; width:430px; border:1px solid #ACD8F0; overflow:auto; } #usermsg { width:395px; border:1px solid #ACD8F0; } #menu { padding:12.5px 25px 12.5px 25px; } .welcome { float:left; } .logout { float:rightright; } .msgln { margin:0 0 2px 0; } Make a file called log.html Here's a screenshot:
  23. Sure post the the files and maybe a screenshot of it..
  24. In profiles.php add the code below before the profile information: if ($profile_class->hospital != 0) { $status = "[url='hospital.php']In Hospital[/url]"; } else if ($profile_class->jail != 0) { $status = "[url='prison.php']In Prison[/url]"; } else { $status = "-"; } Also add: <td><h4>Status:</h4></td> <td><? echo $status ?></td> where ever you have the users information. You might take out the <h4></h4> if you don't have css on <h4></h4>. Some screenshots of what it looks like:
×
×
  • Create New...