Jump to content
MakeWebGames

Daron

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Daron

  1. Daron

    Create Weapons??

    im using mccodes.
  2. Daron

    Create Weapons??

    alright so i made a weapons shop using phpmyadmin, by just filling in the fields. but how do i make weapons and add them to the shop?? like how would make the damage formula for like sword stronger that knife & etc.
  3. ok i was told by a freind to skip crons for now since its a offline wbsite. he crons is a given with a host. but do u know how to create weapons & shops? like i see the tables in the db but i have no clue how to make the shops & items. especially items, like how to set the damage formula for weapons & etc.
  4. thanx it worked. i feel like i been really working you lately lol srry if i have. but before i begin this process, i wanna know do i suppose to use windows task schelduer to make my cron jobs? i realized my energy & things are replenishing. i know i need to set cron jobs but im not sure is windows task schelduer is right thing to do.
  5. yup but i tried using what u did earlier to solve another undefined offset. heres what i tried that didnt work error on 4th line while ($tick = current($array_poste)) { $thekey = key($array_poste); if (isset ($_POST[$thekey])) { $_POST[$thekey] = str_replace("=", "", htmlspecialchars($_POST[$thekey])); next($array_poste); and here is the orignal code error on line 3 while ($tick = current($array_poste)) { $thekey = key($array_poste); $_POST[$thekey] = str_replace("=", "", htmlspecialchars($_POST[$thekey])); next($array_poste);
  6. YES! im so smart! while i was waiting for u to reply i had ended up curing it on my own. i had inserted a echo mysql_error() and it said unknown column u.userid i field list, so i just erased all the 'u' and it worked :) i got the whole comment system done, i had to outsource and mix someone's free mod on her with my own. i did half & half and i got it right.
  7. ok so i changed the code up but i still get the Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean Its on line 2 $Data=mysql_query("SELECT g.`ID`,g.`SenderID`,g.`RecieverID`,g.`Comment`,u.` userid`,u.`username` FROM `gComments` g LEFT JOIN `users` u "."ON g.`SenderID` = u.`userid` WHERE (`RecieverID` = ".abs(intval($_GET['u'])).") LIMIT 20"); while($cData = mysql_fetch_array($Data)) { echo (' <tr> <td width = "15%">'.htmlentities($cData['username']).'</td> <td>'.stripslashes(htmlentities($cData['Comment'], ENT_QUOTES)).'</td>'); if($ir['userid'] == $r['userid'] || $ir['user_level'] > 1) { print"<td width=10%><a href=comments.php?action=delete&ID={$cmnt['cmtID']}>Delete</a></td>"; } print"</tr>"; } print"</table>";
  8. i can give u a list of 54 missions i did for another game if you help with a problem im having with a current game im working on. it involves leaving profile comments. i cant get that right.
  9. WARNING: mysql_fetch_array() expects parameter 1 to be resource, boolean $blah=mysql_query("SELECT * FROM comments WHERE cmtTO={$r['userid']} ORDER BY cmtTIME DESC limit 5", $c); while($cmnt=mysql_fetch_array($blah)) { $they=mysql_query("SELECT * FROM users WHERE userid={$cmnt['cmtFROM']}",$c); $them=mysql_fetch_array($they); $sent=date('F j, Y, g:i:s a',$cmnt['cmtTIME']); print"<td width=25%><b>{$them['username']} [{$them['userid']}]</br></br></b>$sent</td><Td>{$cmnt['cmtTEXT']}</td>"; if($ir['userid'] == $r['userid'] || $ir['user_level'] > 1) { print"<td width=10%><a href=comments.php?action=delete&ID={$cmnt['cmtID']}>Delete</a></td>"; } on line 2 i tried adding a table called comments to db & made it varchar(140) but that didnt work.
  10. ah another isset. i tried it myself but it didnt work. i must have put it in wrong unless u did something else besides adding a isset.
  11. i keep getting a notice saying undefined offset:0 how to fix it?? here is the code $array_gete = array($_GET); while ($tick = current($array_gete)) { $thekey = key($array_gete); $_GET[$thekey] = str_replace("=", "", htmlspecialchars($_GET[$thekey])); next($array_gete); } it says its on line 4.
  12. ok 1st of all i just wanna let u know u been very helpful. and using what u told me i cleared every notice on my 1st page except 1 that i cant get. its saying Undefined Offset: 0 $array_gete = array($_GET); while ($tick = current($array_gete)) { $thekey = key($array_gete); $_GET[$thekey] = str_replace("=", "", htmlspecialchars($_GET[$thekey])); next($array_gete); } line 4 is the line that has the undefined offset: 0
  13. ok so i examined the code & fixed the burntime thing. i just had to remove isset edit: i fixed both now. it was same fix, just had to remove isset.
  14. ah cool so i take it im on the right track. but i came across another WIERD situation. if i add burntime to db it will always say your house will be repaired in # minutes. & if i add travel time to db it wont let me do nothing and be like your are traveling for 0 minutes. is there a way to keep them in db but have them inactive when the value is 0. this is travel time code if(isset($ir['ttime']) > 0) { $q=mysql_query("SELECT * FROM users WHERE userid=$userid",$c); $r=mysql_fetch_array($q); die("<br><br><center><img src='airplane.jpg'><br/><b>You are traveling. You have {$ir['ttime']} minutes left. Sit back and enjoy the flight.<br/>We reccomend you <a href='http://www.criminalisland.com/chat.php' target='_new'>CLICK HERE</a> and connect to the chatroom while you wait!</center><br /> "); } This is burntime code if(!$ir['BurnTime'] && $ir['BurnHouse']>=100) { print "<b><font color=red>Your house is ready to be repaired click <a href='BRepair.php'><font color=green>Here</font></a> to Finalize.</font></b><br>"; }
  15. ah okay. & i hope this isnt too personal but did u go to college? if so what courses helped you become as intelligent as you are now?
  16. ah so my hunch was right. i just didnt think it was right because i didnt think so many tables would go in a users table. i have 60 tables so far.
  17. okay i cant fix the undefined on this stelth thing. i fixed it on the http_x_forwarded tho. function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if($ir['stelth'] == 1) { $db->query("UPDATE users SET lastip='$IP' WHERE userid=$userid"); } else { $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); }
  18. ah! but i had did something else before i seen this post & the notice disappeared. i just added quotes around male & female and it worked. the undefined constants WERE for male & female part of the code but i got rid of it now. i just cleared a good amount of notices using what u just taught me. im only 16 and currently trying self teach myself using w3schools and anything else i can find.
  19. yup so adding them to the db worked. now ima try see if i can figure out how to fix an undefined constant. im loving all these new things im learning.
  20. u are so great! i added power & max_power to users table and another undefined notice disappeared. :) :) :)
  21. when i tried isset i got a parse error. & now that u mentioned it i didnt see those in my db lol. im actually re-building a text based mmorpg a friend of mine used to have. now that i look it the db user_stats its IQ,Labour,Guard, Agility, & Strength. & in users table here some thats related to stats; exp, energy, will, brave, hp, & crime exp. so now im wondering do the 'power' really belong? but im sure it dose cuz my friend currently has a running website so im sure he wouldnt make a amateur mistake like that.
  22. o okay yea i recognize the isset i actually used that alot to clear up alot of notices on my log-in page that i USED to have :) but yea i'll the isset on my next notice that i have. its a undefined on max_power & mine_needed on lines 1 & 4. if($ir['max_power'] > 0 && $ir['power'] > 0) { $power=(int) ($ir['power']/$ir['max_power']*100); } else { $power=(int) (0); } if($ir['mine_needed'] > 0 && $ir['mine_exp'] > 0) { $minexp=(int) ($ir['mine_exp']/$ir['mine_needed']*100); } else { $minexp =(int) (0); }
  23. thank u so much. it cleared up 2 off the undefined errors on the web page when i hit login. ima try see if i can clear the rest up. Thank u ur awesome! is there like a rating system or something on here.
  24. could you give me an example or tell me how i would do that. heres my globals.php code   <?php /*--------------------------------- -- MCCodes 2.0 -- By Dabomstew ---------------------------------*/ session_start(); ob_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $domain=$_SERVER['HTTP_HOST']; global $jobquery, $housequery; if($jobquery) { $is=$db->query("SELECT u.*,us.*,j.*,jr.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON jr.jrID=u.jobrank WHERE u.userid=$userid"); } else if($housequery) { $is=$db->query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid"); } else { $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); } $ir=$db->fetch_row($is); if($ir['force_logout']) { $db->query("UPDATE users SET force_logout=0 WHERE userid=$userid"); session_unset(); session_destroy(); header("Location: login.php"); exit; } global $macropage; if($macropage && !$ir['verified'] && $set['validate_on']==1) { header("Location: macro1.php?refer=$macropage"); exit; } check_level(); $h = new headers; $h->startheaders(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); global $atkpage; if($atkpage) { $h->userdata($ir,$lv,$fm,$cm,0); } else { $h->userdata($ir,$lv,$fm,$cm); } global $menuhide; if(!$menuhide) { $h->menuarea(); } ?>
  25. i keep getting an error notice on my practice website about an undefined index known as fd. heres the code.   <?php define("LOAD_START", microtime(true)); class headers { function startheaders() { $userid=$_SESSION['userid']; global $ir, $set; if ($ir['fd']==0) { $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); } if ($ir['fd']==1) { $enperc=(int) ($ir['energy']/$ir['maxenergy']*150); } $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); if($ir['max_power'] > 0 && $ir['power'] > 0) { $power=(int) ($ir['power']/$ir['max_power']*100); } else { $power=(int) (0); } if($ir['mine_needed'] > 0 && $ir['mine_exp'] > 0) { $minexp=(int) ($ir['mine_exp']/$ir['mine_needed']*100); } else { $minexp =(int) (0); } $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $pow=100-$power; $minex=100-$minexp; $_GET['ID'] = abs(@intval($_GET['ID'])); $_GET['viewforum'] = abs(@intval($_GET['viewforum'])); $_GET['viewtopic'] = abs(@intval($_GET['viewtopic']));
×
×
  • Create New...