Jump to content
MakeWebGames

MDK666

Members
  • Posts

    268
  • Joined

  • Last visited

Everything posted by MDK666

  1. well ummm heres my header for everyone since you guys are having problems installing it, just to let you know i have the theme mod installed so ull need that unless u rip it out of the header but other then that here you guys go.   <?php class headers { function startheaders() { global $db,$ir,$c,$h,$userid,$set,$theme; $q = $db->query("SELECT ThemeID FROM users WHERE userid=$userid",$c); $t = $db->fetch_row($q); echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <link rel="stylesheet" type="text/css" href="{$t['ThemeID']}.css" /> </head> <body> <center><table width="800" border="0" cellpadding="0" cellspacing="0" class="table2"> <td class="center"> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid,$set; $IP = $_SERVER['REMOTE_ADDR']; if((isset($_SESSION['userAgent'])) && sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION['userAgent']) { session_unset(); session_destroy(); header(login.php); } else { $_SESSION['userAgent'] = sha1($_SERVER['HTTP_USER_AGENT']); } $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You lost all your EXP for running from the fight."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $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); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=/images/donator.gif]"; } $gn=""; global $staffpage; print <<<OUT <table width="800"><tr><td width="800" height="230" class="logo"></td></tr></table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <table width="800"> <tr> <td>[b]Name:[/b] $gn{$u} [{$ir['userid']}]</td> <td>[b]Level:[/b] {$ir['level']}</td> <td>[b]Money:[/b] {$fm}</td> <td>[b]{$set['game_currency']}:[/b] {$ir['crystals']}</td> <td>[[url='logout.php']<font color=red>Emergency Logout</font>[/url]]</td> </tr> <tr> <td>[b]{$set['game_energy']}:[/b] {$enperc}% <img src=images/bar_left.gif height=5><img src=images/greenbar.gif width=100 height=5><img src=images/redbar.gif width=0 height=5><img src=images/bar_fil_end.png height=5></td> <td>[b]{$set['game_will']}:[/b] {$wiperc}% <img src=images/bar_left.gif height=5><img src=images/greenbar.gif width=100 height=5><img src=images/redbar.gif width=0 height=5><img src=images/bar_fil_end.png height=5></td> <td>[b]{$set['game_brave']}:[/b] {$ir['brave']}/{$ir['maxbrave']} <img src=images/bar_left.gif height=5><img src=images/greenbar.gif width=100 height=5><img src=images/redbar.gif width=0 height=5><img src=images/bar_fil_end.png height=5></td> <td>[b]{$set['game_exp']}:[/b] {$experc}% <img src=images/bar_left.gif height=5><img src=images/greenbar.gif width=100 height=5><img src=images/redbar.gif width=0 height=5><img src=images/bar_fil_end.png height=5></td> <td>[b]{$set['game_health']}:[/b] {$hpperc}% <img src=images/bar_left.gif height=5><img src=images/greenbar.gif width=100 height=5><img src=images/redbar.gif width=0 height=5><img src=images/bar_fil_end.png height=5></td> </tr> <table width="100%" border="0" cellpadding="0" cellspacing="0"> OUT; include('mainmenu1.php'); if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>"); } } function menuarea() { global $ir,$c; if($ir['donatordays'] && $ir['don_evented']) { event_add($ir['userid'], 'You have '.$ir['donatordays'].' left, click [url="donator.php"]here[/url] to buy more donator packs!'); } print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td><td width="0%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td> <td width="0%" bgcolor="#'.$bgcolor.'" valign="top"><table><tr><center>'; } function endpage() { global $db; print <<<OUT </center></td></tr></table></td> <td class="rgrad"></td></tr> <tr><td colspan="3"><table cellpadding="0" cellspacing="0" border="0" width="100%"> </table></td></tr></table></table></body></html> OUT; } } ?>
  2. ok well make sure to look at my drop-down menu that i just released, you might like it or find something else to use it for or even make it better so i hope u enjoy it...
  3. Well its been awhile now since i released anything so i though id release my drop-down menu that i use in my game.. Create a new file called "mainmenu1.php" <?php global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; $city=mysql_fetch_object(mysql_query("SELECT cityname FROM cities WHERE cityid = ".$ir['location']." ")); print "<html><head> <link rel='stylesheet' type='text/css' href='pro_dropdown_2.css' /> <script src='stuHover.js' type='text/javascript'></script> </head><body><center> <span class='preload1'></span> <span class='preload2'></span> <ul id='nav'> <li class='top'>[url='index.php']<span>Home</span>[/url] <li class='top'>[url='#nogo2']<span class='down'>Player</span>[/url] <ul class='sub'> [*][url='inventory.php']Inventory[/url] [*][url='events.php']Events[/url] [*][url='mailbox.php']Mailbox[/url] [*][url='myevents.php']My Events[/url] [*][url='announcements.php']Announcements[/url] [*][url='preferences.php']Player Settings[/url] [*][url='hospital.php']Hospital ($hc)[/url] [*][url='jail.php']Jail ($jc)[/url][/list]"; print"<li class='top'>[url='explore.php']<span>$city->cityname</span>[/url] <li class='top'>[url='#noto23']<span class='down'>Credits</span>[/url] <ul class='sub'> [*][url='donator.php']Buy Credits[/url] [*][url='cmarket.php']Credit Market[/url] [*][url='sendcrys.php']Transfer Credits[/url] [*][url='crystaltemple.php']Use Credits[/url] [/list] <li class='top'>[url='#nogo27']<span class='down'>Gang</span>[/url] <ul class='sub'> [*][url='zFamily.php']Create Gang[/url]"; if(!$ir['jail'] && $ir['gang']) { print "[*][url='zFamily.php?p=myFam']Your Gang[/url]"; } print "[/list] <li class='top'>[url='#nogo53']<span class='down'>General</span>[/url] <ul class='sub'> [*][url='criminal.php']Crimes[/url] [*][url='job.php']Jobs[/url] [*][url='gym.php']Gym[/url] [*][url='education.php']School[/url] [*][url='newspaper.php']Newspaper[/url] [*][url='search.php']Search[/url] [*][url='forums.php']Forums[/url] [*][url='preport.php']Player Report[/url] [/list] "; if($ir['donatordays']) { print "<li class='top'>[url='#nogo53']<span class='down'>Donators</span>[/url] <ul class='sub'> [*][url='friendlist.php']Friends List[/url] [*][url='blacklist.php']Black List[/url][/list]"; } if($ir['user_level'] > 1) { print "<li class='top'>[url='staff.php']<span>Staff Panel</span>[/url][/list]</center></body></html>"; } ?> Create a file called "pro_dropdown_2.css .preload1 {background: url(three_1.gif);} .preload2 {background: url(three_1a.gif);} #nav {padding:0; margin:0; list-style:none; height:38px; background:#ccc url(three_0.gif) repeat-x; position:relative; z-index:500; font-family:arial, verdana, sans-serif;} #nav li.top {display:block; float:left; height:38px;} #nav li a.top_link {display:block; float:left; height:35px; line-height:33px; color:#ccc; text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px; cursor:pointer;background: url(three_0.gif);} #nav li a.top_link span {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(three_0.gif) right top no-repeat;} #nav li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(three_0a.gif) no-repeat right top;} #nav li:hover a.top_link {color:#fff; background: url(three_1.gif) no-repeat;} #nav li:hover a.top_link span {background:url(three_1.gif) no-repeat right top;} #nav li:hover a.top_link span.down {background:url(three_1a.gif) no-repeat right top;} /* Default list styling */ #nav li:hover {position:relative; z-index:200;} #nav li:hover ul.sub {left:1px; top:38px; background: #bbd37e; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:90px; height:auto; z-index:300;} #nav li:hover ul.sub li {display:block; height:20px; position:relative; float:left; width:90px; font-weight:normal;} #nav li:hover ul.sub li a {display:block; font-size:11px; height:18px; width:88px; line-height:18px; text-indent:5px; color:#000; text-decoration:none;border:1px solid #bbd37e;} #nav li ul.sub li a.fly {background:#bbd37e url(arrow.gif) 80px 6px no-repeat;} #nav li:hover ul.sub li a:hover {background:#6a812c; color:#fff; border-color:#fff;} #nav li:hover ul.sub li a.fly:hover {background:#6a812c url(arrow_over.gif) 80px 6px no-repeat; color:#fff;} #nav li:hover li:hover ul, #nav li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover li:hover ul {left:90px; top:-4px; background: #bbd37e; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:90px; z-index:400; height:auto;} #nav ul, #nav li:hover ul ul, #nav li:hover li:hover ul ul, #nav li:hover li:hover li:hover ul ul, #nav li:hover li:hover li:hover li:hover ul ul {position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;} #nav li:hover li:hover a.fly, #nav li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover li:hover a.fly {background:#6a812c url(arrow_over.gif) 80px 6px no-repeat; color:#fff; border-color:#fff;} #nav li:hover li:hover li a.fly, #nav li:hover li:hover li:hover li a.fly, #nav li:hover li:hover li:hover li:hover li a.fly {background:#bbd37e url(arrow.gif) 80px 6px no-repeat; color:#000; border-color:#bbd37e;} Create a file called "stuHover.js" stuHover = function() { var cssRule; var newSelector; for (var i = 0; i < document.styleSheets.length; i++) for (var x = 0; x < document.styleSheets[i].rules.length ; x++) { cssRule = document.styleSheets[i].rules[x]; if (cssRule.selectorText.indexOf("LI:hover") != -1) { newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover"); document.styleSheets[i].addRule(newSelector , cssRule.style.cssText); } } var getElm = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<getElm.length; i++) { getElm[i].onmouseover=function() { this.className+=" iehover"; } getElm[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" iehover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", stuHover); Open up header and find: include('mainmenu.php'); and replace with include('mainmenu1.php'); now open up "smenu.php and overwrite it with this one <?php global $db,$c,$ir, $set; print "<html><head> <link rel='stylesheet' type='text/css' href='pro_dropdown_2.css' /> <script src='stuHover.js' type='text/javascript'></script> </head><body><center> <span class='preload1'></span> <span class='preload2'></span> <ul id='nav'> <li class='top'>[url='staff.php']<span>Index</span>[/url] <li class='top'>[url='#nogo1']<span class='down'>Settings</span>[/url] <ul class='sub'>"; if($ir['user_level']==2) { print "[*][url='staff.php?action=basicset']Basic Settings[/url] [*][url='staff.php?action=announce']Add Announcement[/url][/list]"; } if($ir['user_level']==2) { print "<li class='top'>[url='#nogo2']<span class='down'>Staff Menu 1</span>[/url] <ul class='sub'> [*][url='#nogo3']Users[/url] <ul> [*][url='staff_users.php?action=newuser']Create New User[/url] [*][url='staff_users.php?action=edituser']Edit User[/url] [*][url='staff_users.php?action=deluser']Delete User[/url] [*][url='staff_users.php?action=invbeg']View Inventory[/url] [*][url='staff_users.php?action=creditform']Credit User[/url] [*][url='staff_users.php?action=masscredit']Mass Payment[/url] [*][url='staff_users.php?action=forcelogout']Force Logout[/url] [*][url='staff_users.php?action=reportsview']Player Reports[/url] [/list] [*][url='#nogo4']Items[/url] <ul> [*][url='staff_items.php?action=newitem']Create New Item[/url] [*][url='staff_items.php?action=giveitem']Give Item To User[/url] [*][url='staff_items.php?action=edititem']Edit Item[/url] [*][url='staff_items.php?action=killitem']Delete An Item[/url] [*][url='staff_items.php?action=newitemtype']Add Item Type[/url] [/list] [*][url='#nogo5']Themes[/url] <ul> [*][url='staff_themecreator.php?action=newtheme']Add A New Theme[/url] [*][url='staff_themecreator.php?action=edittheme']Edit A Theme[/url] [*][url='staff_themecreator.php?action=deltheme']Delete A Theme[/url] [/list][/list] <li class='top'>[url='#nogo2']<span class='down'>Staff Menu 2</span>[/url] <ul class='sub'> [*][url='#nogo3']Logs[/url] <ul> [*][url='staff_logs.php?action=atklogs']Attack Logs[/url] [*][url='staff_logs.php?action=cashlogs']Cash Xfer Logs[/url] [*][url='staff_logs.php?action=cryslogs']Credit Xfer Logs[/url] [*][url='staff_logs.php?action=banklogs']Bank Xfer Logs[/url] [*][url='staff_logs.php?action=itmlogs']Item Xfer Logs[/url] [*][url='staff_logs.php?action=maillogs']Mail Logs[/url] [*][url='staff_logs.php?action=stafflogs']Staff Logs[/url] [/list] [*][url='#nogo4']Gangs[/url] <ul> [*][url='staff_gangs.php?action=grecord']Gang Record[/url] [*][url='staff_gangs.php?action=gcredit']Credit Gang[/url] [*][url='staff_gangs.php?action=gwar']Gang Wars[/url] [*][url='staff_gangs.php?action=gedit']Edit Gang[/url] [/list] [*][url='#nogo5']Shops[/url] <ul> [*][url='staff_shops.php?action=newshop']Create New Shop[/url] [*][url='staff_shops.php?action=newstock']Add Item To Shop[/url] [*][url='staff_shops.php?action=delshop']Delete Shop[/url] [/list][/list] <li class='top'>[url='#nogo2']<span class='down'>Staff Menu 3</span>[/url] <ul class='sub'> [*][url='#nogo3']Polls[/url] <ul> [*][url='staff_polls.php?action=spoll']Start Poll[/url] [*][url='staff_polls.php?action=endpoll']End A Poll[/url] [/list] [*][url='#nogo4']Jobs[/url] <ul> [*][url='staff_jobs.php?action=newjob']Make a new Job[/url] [*][url='staff_jobs.php?action=jobedit']Edit a Job[/url] [*][url='staff_jobs.php?action=jobdele']Delete a Job[/url] [*][url='staff_jobs.php?action=newjobrank']Make Job Rank[/url] [*][url='staff_jobs.php?action=jobrankedit']Edit Job Rank[/url] [*][url='staff_jobs.php?action=jobrankdele']Delete Job Rank[/url] [*][url='staff_jobs.php?action=newjobspec']Make a new Job Special[/url] [*][url='staff_jobs.php?action=jobspecedit']Edit a Job Special[/url] [*][url='staff_jobs.php?action=jobspecdele']Delete a Job Special[/url] [/list] [*][url='#nogo5']Houses[/url] <ul> [*][url='staff_houses.php?action=addhouse']Add House[/url] [*][url='staff_houses.php?action=edithouse']Edit House[/url] [*][url='staff_houses.php?action=delhouse']Delete House[/url] [/list][/list] <li class='top'>[url='#nogo2']<span class='down'>Staff Menu 4</span>[/url] <ul class='sub'> [*][url='#nogo3']Citys[/url] <ul> [*][url='staff_cities.php?action=addcity']Add City[/url] [*][url='staff_cities.php?action=editcity']Edit City[/url] [*][url='staff_cities.php?action=delcity']Delete City[/url] [/list] [*][url='#nogo4']Forums[/url] <ul> [*][url='staff_forums.php?action=addforum']Add Forum[/url] [*][url='staff_forums.php?action=editforum']Edit Forum[/url] [*][url='staff_forums.php?action=delforum']Delete Forum[/url] [/list] [*][url='#nogo3']Crimes[/url] <ul> [*][url='staff_crimes.php?action=newcrime']Create Crime[/url] [*][url='staff_crimes.php?action=editcrime']Edit Crime[/url] [*][url='staff_crimes.php?action=delcrime']Delete Crime[/url] [*][url='staff_crimes.php?action=newcrimegroup']Create Group[/url] [*][url='staff_crimes.php?action=editcrimegroup']Edit Group[/url] [*][url='staff_crimes.php?action=delcrimegroup']Delete Group[/url] [*][url='staff_crimes.php?action=reorder']Reorder Groups[/url] [/list] [*][url='#nogo5']Courses[/url] <ul> [*][url='staff_courses.php?action=addcourse']Add Course[/url] [*][url='staff_courses.php?action=editcourse']Edit Course[/url] [*][url='staff_courses.php?action=delcourse']Delete Course[/url] [/list][/list] <li class='top'>[url='#nogo2']<span class='down'>Staff Menu 5</span>[/url] <ul class='sub'> [*][url='#nogo3']Battle Tent[/url] <ul> [*][url='staff_battletent.php?action=addbot']Add Bot[/url] [*][url='staff_battletent.php?action=editbot']Edit Bot[/url] [*][url='staff_battletent.php?action=delbot']Remove Bot[/url] [/list] [*][url='#nogo4']Punishments[/url] <ul> [*][url='staff_punit.php?action=mailform']Mail Ban User[/url] [*][url='staff_punit.php?action=unmailform']Un-Mailban User[/url] [*][url='staff_punit.php?action=forumform']Forum Ban User[/url] [*][url='staff_punit.php?action=unforumform']Un-Forumban User[/url] [*][url='staff_punit.php?action=fedform']Jail User[/url] [*][url='staff_punit.php?action=fedeform']Edit Fedjail Sentence[/url] [*][url='staff_punit.php?action=unfedform']Unjail User[/url] [*][url='staff_punit.php?action=ipform']Ip Search[/url] [/list] [*][url='#nogo4']Special[/url] <ul> [*][url='staff_special.php?action=editnews']Edit Newspaper[/url] [*][url='staff_special.php?action=massmailer']Mass mailer[/url] [*][url='staff_special.php?action=stafflist']Staff List[/url] [*][url='staff_special.php?action=userlevelform']Adjust User Level[/url] [*][url='staff_special.php?action=givedpform']Give User Donator Pack[/url] [*][url='staff_gamestats.php']Game Stats[/url] [*][url='staff_reset.php']Reset Game[/url] [/list][/list] </body></html>"; } ?> then use the images attached below make sure there in the root of your game AKA public_html. and have fun with the new menu... here is a screenshot of the main menu, the staff menu looks the same but with different options.
  4. it might of worked for you but i had to play with the scripts awhile as i was getting the same errors everyone else was getting so i just left the armor rows in the 2 tables which removed most of the errors other then the create items which was picking up special, ring, and etc and gave a error there so i went through the staff_items and inventory and fixed the few errors i did recieve, as of right now the mod is working great since i fixed the errors so im not sure where they were comming from untill i do find out i just suggest everyone to leave the equip_armor in the tables till these errors are sorted out.
  5. well for a small hint on people that are having errors in staff_items.php items table, and users table dont remove the armor from either of them.... Overwrite inventory with this one. <?php require_once("globals.php"); $q=$db->query("SELECT * FROM `items` WHERE `itmid` IN({$ir['equip_primary']},{$ir['equip_armor']},{$ir['equip_helmet']},{$ir['equip_boots']},{$ir['equip_leggings']},{$ir['equip_gloves']},{$ir['equip_breastplate']})"); echo "<h3>Equipped Items</h3><hr />"; while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } echo "<table width='75%' cellspacing='1' class='table'> <tr> <th>Helmet</th> <td>"; if($equip[$ir['equip_helmet']]['itmid']) { echo $equip[$ir['equip_helmet']]['itmname']."</td><td>[url='unequip.php?type=equip_helmet']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo '</tr> <tr> <th>Breast Plate</th> <td>'; if($equip[$ir['equip_breastplate']]['itmid']) { echo $equip[$ir['equip_breastplate']]['itmname']."</td> <td>[url='unequip.php?type=equip_breastplate']Unequip Item[/url]</td>"; } else { print 'None equipped.</td><td> </td>'; } print '</tr> </tr> <tr> <th>Primary Weapon</th> <td>'; if($equip[$ir['equip_primary']]['itmid']) { echo $equip[$ir['equip_primary']]['itmname']."</td> <td>[url='unequip.php?type=equip_primary']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo '</tr> <tr> <th>Secondary Weapon</th> <td>'; if($equip[$ir['equip_secondary']]['itmid']) { echo $equip[$ir['equip_secondary']]['itmname']."</td><td>[url='unequip.php?type=equip_secondary']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo '</tr> <tr> <th>Leggings</th> <td>'; if($equip[$ir['equip_leggings']]['itmid']) { echo $equip[$ir['equip_leggings']]['itmname']."</td> <td>[url='unequip.php?type=equip_braclet']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo '</tr> <tr> <th>Gloves</th> <td>'; if($equip[$ir['equip_gloves']]['itmid']) { echo $equip[$ir['equip_gloves']]['itmname']."</td> <td>[url='unequip.php?type=equip_ring']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo '</tr> <tr> <th>Boots</th> <td>'; if($equip[$ir['equip_boots']]['itmid']) { echo $equip[$ir['equip_boots']]['itmname']."</td><td>[url='unequip.php?type=equip_boots']Unequip Item[/url]</td>"; } else { echo 'None equipped.</td><td> </td>'; } echo "</tr> </table><hr /> <h3>Inventory</h3><hr />"; $inv=$db->query("SELECT iv.*,i.*,it.* FROM `inventory` iv LEFT JOIN `items` i ON iv.`inv_itemid`=i.`itmid` LEFT JOIN `itemtypes` it ON i.`itmtype`=it.`itmtypeid` WHERE iv.`inv_userid`={$userid} ORDER BY i.`itmtype` ASC, i.`itmname` ASC"); if ($db->num_rows($inv) == 0) { echo "[b]You have no items\![/b]"; } else { echo "[b]Your items are listed below.[/b] <table width=100% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; echo "\n<tr><td colspan=4>[b]{$lt}[/b]</td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } if($i['helmet']) { $i['itmname']="<font color='blue'>*</font>".$i['itmname']; } if($i['boots']) { $i['itmname']="<font color='pink'>*</font>".$i['itmname']; } if($i['breastplate']) { $i['itmname']="<font color='brown'>*</font>".$i['itmname']; } if($i['leggings']) { $i['itmname']="<font color='yellow'>*</font>".$i['itmname']; } if($i['gloves']) { $i['itmname']="<font color='lime'>*</font>".$i['itmname']; } echo "<tr><td>".$i['itmname'].""; if ($i['inv_qty'] > 1) { echo "x".$i['inv_qty'].""; } echo "</td><td>$".$i['itmsellprice']."</td><td>"; echo "$".($i['itmsellprice']."*".$i['inv_qty']).""; echo "</td><td>[[url='iteminfo.php?ID=".$i[']Info[/url]]"; echo ' [[url="itemsend.php?ID='.$i['inv_id'].'"]Send[/url]] [[url="itemsell.php?ID='.$i['inv_id'].'"]Sell[/url]] [[url="imadd.php?ID='.$i['inv_id'].'"]Add To Market[/url]] [[url="itemuse.php?ID='.$i['inv_id'].'"]Use[/url]]'; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { echo ' [[url="itemuse.php?ID='.$i['inv_id'].'"]Use[/url]]'; } if($i['weapon']) { echo ' [[url="equip_weapon.php?ID='.$i['inv_id'].'"]Equip as Weapon[/url]]'; } if($i['armor']) { echo ' [[url="equip_armor.php?ID='.$i['inv_id'].'"]Equip as Armor[/url]]'; } if($i['helmet']) { echo ' [[url="equip_helmet.php?ID='.$i['inv_id'].'"]Equip as Helmet[/url]]'; } if($i['boots']) { echo ' [[url="equip_boots.php?ID='.$i['inv_id'].'"]Equip as Boots[/url]]'; } if($i['breastplate']) { echo ' [[url="equip_breastplate.php?ID='.$i['inv_id'].'"]Equip as BreastPlate[/url]]'; } if($i['leggings']) { echo ' [[url="equip_leggings.php?ID='.$i['inv_id'].'"]Equip as Leggings[/url]]'; } if($i['gloves']) { echo ' [[url="equip_ring.php?ID='.$i['inv_id'].'"]Equip as Gloves[/url]]'; } echo '</td></tr>'; } echo '</table>'; echo '[size="1"][b]NB:[/b] Items with a small red [/size]<font color="red">*</font>[size="1"] next to their name can be used as weapons in combat. Items with a small green [/size]<font color="green">*</font>[size="1"] next to their name can be used as armor in combat. Items with a small blue [/size]<font color="blue">*</font>[size="1"] next to their name can be used as a helmet in combat. Items with a small pink [/size]<font color="pink">*</font>[size="1"] next to their name can be used as boots in combat. Items with a small brown [/size]<font color="brown">*</font>[size="1"] next to their name can be used as leggings in combat. Items with a small lime [/size]<font color="lime">*</font>[size="1"] next to their name can be used as a breastplate in combat. Items with a small yellow [/size]<font color="yellow">*</font><small> next to their name can be used as gloves in combat. '; } $h->endpage(); ?>   And overwrite staff_items.php with this one..   <?php include "sglobals.php"; //This contains item stuffs switch($_GET['action']) { case 'newitem': new_item_form(); break; case 'newitemsub': new_item_submit(); break; case 'giveitem': give_item_form(); break; case 'giveitemsub': give_item_submit(); break; case 'killitem': kill_item_form(); break; case 'killitemsub': kill_item_submit(); break; case 'edititem': edit_item_begin(); break; case 'edititemform': edit_item_form(); break; case 'edititemsub': edit_item_sub(); break; case 'newitemtype': newitemtype(); break; default: print "Error: This script requires an action."; break; } function new_item_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an item to the game</h3><form action='staff_items.php?action=newitemsub' method='post'> Item Name: <input type='text' name='itmname' value='' /> Item Desc.: <input type='text' name='itmdesc' value='' /> Item Type: ".itemtype_dropdown($c,'itmtype')." Item Buyable: <input type='checkbox' name='itmbuyable' checked='checked' /> Item Price: <input type='text' name='itmbuyprice' /> Item Sell Value: <input type='text' name='itmsellprice' /> <hr /> [b]Usage Form[/b]<hr /> [b]<u>Effect 1</u>[/b] On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No Stat: <select name='effect1stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='credits'>Creditss</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect1dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 2</u>[/b] On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No Stat: <select name='effect2stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='credits'>Credits</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect2dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 3</u>[/b] On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No Stat: <select name='effect3stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='credits'>Credits</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect3dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect3amount' value='0' /> <select name='effect3type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]Combat Usage[/b] Helmet Defense: <input type='text' name='helmet' value='0' /> Weapon Power: <input type='text' name='weapon' value='0' /> Boots Defense: <input type='text' name='boots' value='0' /> BreastPlate Defense: <input type='text' name='breastplate' value='0' /> Armor Defense: <input type='text' name='armor' value='0' /> Leggings Defense: <input type='text' name='leggings' value='0' /> Gloves Defense: <input type='text' name='gloves' value='0' /> <input type='submit' value='Add Item To Game' /></form>"; } function new_item_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='admin.php?action=newitem']> Back[/url]"; $h->endpage(); exit; } $itmname=$db->escape($_POST['itmname']); $itmdesc=$db->escape($_POST['itmdesc']); $weapon=abs((int) $_POST['weapon']); $helmet=abs((int) $_POST['helmet']); $boots=abs((int) $_POST['boots']); $breastplate=abs((int) $_POST['breastplate']); $leggings=abs((int) $_POST['leggings']); $gloves=abs((int) $_POST['gloves']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $boots, $helmet, $breastplate, $leggings, $gloves, $armor)"); print "The {$_POST['itmname']} Item was added to the game."; stafflog_add("Created item {$_POST['itmname']}"); } function give_item_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving Item To User</h3> <form action='staff_items.php?action=giveitemsub' method='post'> User: ".user_dropdown($c,'user')." Item: ".item_dropdown($c,'item')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give Item' /></form>"; } function give_item_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$_POST['user']},{$_POST['qty']},0,0)",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"); } function kill_item_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item</h3> The item will be permanently removed from the game. <form action='staff_items.php?action=killitemsub' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Kill Item' /></form>"; } function kill_item_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM items WHERE itmid={$_POST['item']}"); $db->query("DELETE FROM shopitems WHERE sitemITEMID={$_POST['item']}"); $db->query("DELETE FROM inventory WHERE inv_itemid={$_POST['item']}"); $db->query("DELETE FROM itemmarket WHERE imITEM={$_POST['item']}"); print "The {$itemi['itmname']} Item was removed from the game."; stafflog_add("Deleted item {$itemi['itmname']}"); } function edit_item_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing Item</h3> You can edit any aspect of this item. <form action='staff_items.php?action=edititemform' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Edit Item' /></form>"; } function edit_item_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Item</h3> <form action='staff_items.php?action=edititemsub' method='post'> <input type='hidden' name='itmid' value='{$_POST['item']}' /> Item Name: <input type='text' name='itmname' value='{$itemi['itmname']}' /> Item Desc.: <input type='text' name='itmdesc' value='{$itemi['itmdesc']}' /> Item Type: ".itemtype_dropdown($c,'itmtype',$itemi['itmtype'])." Item Buyable: <input type='checkbox' name='itmbuyable'"; if ($itemi['itmbuyable']) { print " checked='checked'"; } print " /> Item Price: <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> Item Sell Value: <input type='text' name='itmsellprice' value='{$itemi['itmsellprice']}' /><hr />[b]Usage Form[/b]<hr />"; $stats=array( "energy" => "Energy", "will" => "Will", "brave" => "Brave", "hp" => "Health", "strength" => "Strength", "agility" => "Agility", "guard" => "Guard", "labour" => "Labour", "IQ" => "IQ", "hospital" => "Hospital Time", "jail" => "Jail Time", "money" => "Money", "credits" => "Credits", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for($i=1;$i<=3;$i++) { if($itemi["effect".$i]) { $efx=unserialize($itemi["effect".$i]); } else { $efx=array("inc_amount" => 0); } $switch1=($itemi['effect'.$i.'_on'] > 0) ? " checked='checked'" : ""; $switch2=($itemi['effect'.$i.'_on'] > 0) ? "" : " checked='checked'"; print "[b]<u>Effect {$i}</u>[/b] On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No Stat: <select name='effect{$i}stat' type='dropdown'>"; foreach($stats as $k => $v) { if($k==$efx['stat']) { print "<option value='{$k}' selected='selected'>{$v}</option>\n"; } else { print "<option value='$k'>{$v}</option>\n"; } } if($efx['dir']=="neg") { $str="<option value='pos'>Increase</option><option value='neg' selected='selected'>Decrease</option>"; } else { $str="<option value='pos' selected='selected'>Increase</option><option value='neg'>Decrease</option>"; } if($efx['inc_type']=="percent") { $str2="<option value='figure'>Value</option><option value='percent' selected='selected'>Percent</option>"; } else { $str2="<option value='figure' selected='selected'>Value</option><option value='percent'>Percent</option>"; } print "</select> Direction: <select name='effect{$i}dir' type='dropdown'>{$str} </select> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select><hr />"; } print "[b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> Helmet Defense: <input type='text' name='helmet' value='{$itemi['helmet']}' /> Boots Defense: <input type='text' name='boots' value='{$itemi['boots']}' /> BreastePlate Defense: <input type='text' name='breastplate' value='{$itemi['breastplate']}' /> Armor Defense: <input type='text' name='armor' value='{$itemi['armor']}' /> Leggings Defense: <input type='text' name='leggings' value='{$itemi['leggings']}' /> Gloves Defense: <input type='text' name='gloves' value='{$itemi['gloves']}' /> <input type='submit' value='Edit Item' /></form>"; } function edit_item_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_items.php?action=edititem']> Back[/url]"; $h->endpage(); exit; } $itmname=$_POST['itmname']; $itmdesc=$_POST['itmdesc']; $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); $helmet=abs((int) $_POST['helmet']); $boots=abs((int) $_POST['boots']); $breastplate=abs((int) $_POST['breastplate']); $leggings=abs((int) $_POST['leggings']); $gloves=abs((int) $_POST['gloves']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $db->query("DELETE FROM items WHERE itmid={$_POST['itmid']}",$c); $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $boots, $helmet, $breastplate, $leggings, $gloves, $armor)"); print "The {$_POST['itmname']} Item was edited successfully."; stafflog_add("Edited item {$_POST['itmname']}"); } function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } $h->endpage(); ?>   now everyone shouldnt be getting any errors with the script if you are let me know what errors and ill try and help to my best of abilitys
  6. make sure that the string for money in the template is money and not something else, as that might be the case, also make sure it matches exactly with your users table.
  7. ummm.... make sure your tables names such as name and money are in the table correctly such as "dont quote me on this" but i think its something like {ir[money]} and {ir[username]} or u could just use the level and crystals one and replace the names of them from the database.
  8. Well, I've had a few people come to me and ask for the images so i decided to zip them up and upload them for everyone so i hope everyone enjoys them
  9. wow someone finally found a use for my inventory mod, congrats im glad to see it went somewhere instead of just being usless so congrats.
  10. acually ben the if that i had posted works also, i use it all the time, so yea mine does work so yea
  11. ok as you noticed from the subject that you can remove all crons from the game, this might sound sceptical but stay with me on this one. instead of using the basic cron jobs or command line as we all use and hate to death well at least i do, but i was reading up on some basic on game design and i came by the idea of a "on-view" method of crons instead of the files. i'm going to try and explain this as best i can on installing this so yea don't get mad if i kinda don't explain it very well for everyone but anyways here goes. Implementing this in your own database is a trivial change; all you need to do is add a timestamp to the table you need to track times for, and then compare it to the current time. Here’s what an example table might look like We will start out by creating a new table in your database:   CREATE TABLE actions ( id int NOT NULL AUTO_INCREMENT, user_id int, energy int, last_updated timestamp, );   And then all you would need to do in your code is something like this, on every page an authenticated user visits   last_time = get_last_update_time(); current_time = get_current_time(); if(current_time - last_time >= tick_duration) { number_of_updates = int((current_time-last_time)/tick_duration); for(i = 0; i < number_of_updates;i++) { update_energy_value(); } }   And that would be essentially all you’d need to do – just check the last time a user’s information was updated, and then update it if it’s been longer than the amount of time you want to update a user’s stats in. Also, if you write your code in such a way that you can just pass in what to update the value with, you can reduce the overhead of using a for() loop as well:   update_energy_value(update_amount * number_of_updates);   Now, this will allow you to keep large amounts of data updated, without encountering any sorts of timeout issues – and is therefore perfect for making sure that things like player stats update themselves at the proper times. However, there are still some areas where it’s better to use cron. For example, let’s say that you are building a browsergame where players health regenerates automatically, at a rate of 1 health every 30 minutes. In this game, time passes just like in the real world – every day counts as a ‘year’ in the game. In this situation, you would want to use the “on-view” method to update the player’s health – but a cronjob would be a much better way to update the “year” value every day. The in-gameyear isn’t really linked to a particular player, and it’s a micro-value – something that is only available in a single place. While you could certainly use the “on-view” method to update the year as well, it’s not quite as practical – a simple cronjob can easily keep your year updated for you, with the added benefit of only running as it’s needed – as opposed to every single time a player visits certain pages. In summary, “on-view” is another way to achieve virtually the same functionality as cron – with a far more reliable way to keep large amounts of data up-to-date when there are many users playing your game. However, there are still places for cron – and both approaches can be used together to provide the best of both worlds. I hope everyone enjoys this also just a quick reminder i did not code this or take action on saying i have coded this, its just information i have found that could help us all out with the cron issues.
  12. that should work but you dont have to use 2 lines on it you can just use if(!$_GET['action']) or name it whatever u want instead of useing $_GET['x'] = isset($_GET['x']) && ctype_alpha($_GET['x']) ? strtolower(trim($_GET['x'])): false; switch($_GET['x'])   then all the links would be http://blabla.com/index.php?action= or whatever you called it. hope that helps
  13. yea i was also gonna agree its just a copy & past of the brothel but good work at the least as you released a new mod for someone who doesn't know how to copy and paste, also i don't understand why you gain money, because when you go to actual disco you have to pay the cover charge to get into the dance so it should deduct money not give u money
  14. you know i was just reading this post and was thinking that if you weren't going to make it i knew i would :thumbup: but coding this mod isnt very difficult even though i do appreciate illusions helping me everytime i needed help and helping new members get started but, anyways before i start getting off topic you could have also used your mod that included a template to select from or even use the code for the settings table but just modify it to be something like "mind you im thinking of the settings code but dont know it off hand, so don't quote me on it." Example: $ir(set['citypic']) thats just for a predefined image. But as for illusions releasing the mod there isn't really a big deal on the code now, nor needing help.
  15. Re: [V2] Revamped Index Page. its a nice mod but... you do not need any of the above mods that you had said other then the houseing images, even not that you can replace that with a user avatar and as the mineing stats that can be replaced with some other type of mod a person might have, thats just my opinion but other that that nice mod +1
  16. Re: Ideas/Requests [Free Mod 4 U] that is true bluedevil but still its in the back of my head that it might be a scam for someone to want a mod, and say he didnt give the person the mod and just sold it for a small profit, he then will be makeing a income while the person with the idea, not getting nothing in return but then again im not sure its just my opinion i feel that i might be over exaderating by a little bit but as i said its just my opinion
  17. Re: Easy Help Tutorial With Admin Feature   either that or he could be missing a table from the query, so make sure you check over all query tables.
  18. Re: Ideas/Requests [Free Mod 4 U] hmmm i seem this is the same as ripping people off, dont get me wrong you could be doing this to help out new members but then again isnt this site mainly to help new users learn to code with mc2, but then again as i said a few moments ago that this could be a rip off not only because ur making the mod for the person, but u could also sell these mod/s to other people from other sites that might support mc2 and sales of mc2 mods and what not, im not exactly sure, but good luck i might get ahold of you for some future modifications.
  19. Re: [mccode v2] Monster Tent hmmm not sure, it seems like to me you didnt update the query, the old query didnt support gender, equip_primary, equip_secondary so delete the monster database and try this one:   CREATE TABLE IF NOT EXISTS `monsters` ( `monsterid` int(11) NOT NULL auto_increment, `monstername` varchar(255) NOT NULL default '', `level` int(11) NOT NULL default '0', `hp` int(11) NOT NULL default '0', `maxhp` int(11) NOT NULL default '0', `money` float NOT NULL default '0', `crystals` float NOT NULL default '0', `diamonds` float NOT NULL default '0', `credits` float NOT NULL default '0', `donatordays` int(11) NOT NULL default '0', `gender` enum('Male','Female') NOT NULL default 'Male', `attacking` int(11) NOT NULL default '0', `equip_primary` int(11) NOT NULL default '0', `equip_secondary` int(11) NOT NULL default '0', `equip_armor` int(11) NOT NULL default '0', PRIMARY KEY (`monsterid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10000000 ;   from there it should work. if any other problems let me know.
  20. Re: Cron Job Replacement sry rainbow if you took my comment the wrong way, if yours does do alot more, then grats on that i was just stateing above when rioter and hawk had stated that there was a free mod of this, other then that have fun with the sell, i would purchase this but there isnt a price listed nor are there any screen shots for people that might want to purchase this, maybe if u had some screenshots people might consider buying this more thats just a suggestion so dont take it as disresepect
  21. Re: [mccode v2] Monster Tent sry but i coded this fresh from my head, and well except the attackmonster.php which is modified to work with the mod, but if u want to think thats the dragon mod then thats opinion but if u think u can find similaritys between the 2 and or have proof this is his then have fun cuz as ill say again this is my codeing.
  22. Re: Cron Job Replacement oh so i see that there are more then the one i posted and the one stated above that Rainbow had made?
  23. Re: Cron Job Replacement   I'm also very aware that this has not to correct your statement of this not being made as a free mod, which it has http://criminalexistence.com/ceforums/i ... ic=29051.0
  24. Re: [mccode v2] Monster Tent New staff_monstertent.php   <?php include "sglobals.php"; //This contains monster stuff switch($_GET['action']) { case 'newmonster': new_monster_form(); break; case 'newmonstersub': new_monster_submit(); break; case 'editmonster': edit_monster_begin(); break; case 'editmonsterform': edit_monster_form(); break; case 'editmonstersub': edit_monster_sub(); break; case 'delmonster': delmonster(); break; default: print "Error: This script requires an action."; break; } function htmlspcl($in) { return str_replace("'", "'", htmlspecialchars($in)); } function new_monster_form() { global $db,$ir, $c; if($ir['user_level'] != 2) { die("403"); } print "Adding a new monster. <form action='staff_monstertent.php?action=newmonstersub' method='post'> Monstername: <input type='text' name='monstername' /> Level: <input type='text' name='level' value='1' /> Money: <input type='text' name='money' value='100' /> Crystals: <input type='text' name='crystals' value='0' /> Diamonds: <input type='text' name='diamonds' value='0' /> Toc Credits: <input type='text' name='credits' value='0' /> Donator Days: <input type='text' name='donatordays' value='0' /> Gender: <select name='gender' type='dropdown'><option>Male</option><option>Female</option></select> <input type='submit' value='Create Monster' /></form>"; } function new_monster_submit() { global $db,$ir,$c,$monsterid; if($ir['user_level'] != 2) { die("403"); } if(!isset($_POST['monstername'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_monstertent.php?action=newmonster']> Back[/url]"; $h->endpage(); exit; } $level=abs((int) $_POST['level']); $money=abs((int) $_POST['money']); $crystals=abs((int) $_POST['crystals']); $diamonds=abs((int) $_POST['diamonds']); $credits=abs((int) $_POST['credits']); $donator=abs((int) $_POST['donatordays']); $strength=abs((int) $_POST['strength']); $agility=abs((int) $_POST['agility']); $guard=abs((int) $_POST['guard']); $labour=abs((int) $_POST['labour']); $iq=abs((int) $_POST['IQ']); $hp=100+$level*100; $maxhp=100+$level*100; $strength=50+$level*50; $agility=50+$level*50; $gaurd=50+$level*50; $labour=50+$level*50; $iq=50+$level*50; $db->query("INSERT INTO monsters (monstername, level, hp, maxhp, money, crystals, diamonds, credits, donatordays, gender, attacking, equip_primary, equip_secondary, equip_armor) VALUES('{$_POST['monstername']}', $level, $hp, $maxhp, $money, $crystals, $diamonds, $credits, $donator, '{$_POST['gender']}', 1, '{$_POST['equip_primary']}', '{$_POST['equip_secondary']}', '{$_POST['equip_armor']}')"); $i=mysql_insert_id($c); $db->query("INSERT INTO monsterstats VALUES($i, $strength, $agility, $guard, $labour, $iq)"); print "Monster [$i] {$_POST['monstername']} created!"; stafflog_add("Created monster {$_POST['monstername']} [$i]"); } function edit_monster_begin() { global $db,$ir,$c,$h,$monsterid; if($ir['user_level'] != 2) { die("403"); } print "<h3>Editing Monster</h3> You can edit any aspect of this monster. <form action='staff_monstertent.php?action=editmonsterform' method='post'> User: ".monster_dropdown($c,'monster')." <input type='submit' value='Edit Monster' /></form> OR enter a monster ID to edit: <form action='staff_monstertent.php?action=editmonsterform' method='post'> Monster: <input type='text' name='monster' value='0' /> <input type='submit' value='Edit Monster' /></form>"; } function edit_monster_form() { global $db,$ir,$c,$h,$monsterid; if($ir['user_level'] != 2) { die("403"); } $d=$db->query("SELECT u.*,us.* FROM monsters u LEFT JOIN monsterstats us on u.monsterid=us.monsterid WHERE u.monsterid={$_POST['monster']}"); $itemi=$db->fetch_row($d); $itemi['hospreason']=htmlspcl($itemi['hospreason']); $itemi['jail_reason']=htmlspcl($itemi['jail_reason']); print "<h3>Editing User</h3> <form action='staff_monstertent.php?action=editmonstersub' method='post'> <input type='hidden' name='monsterid' value='{$_POST['monster']}' /> Monstername: <input type='text' name='monstername' value='{$itemi['monstername']}' /> Level: <input type='text' name='level' value='{$itemi['level']}' /> Money: \$<input type='text' name='money' value='{$itemi['money']}' /> Diamonds: \$<input type='text' name='diamonds' value='{$itemi['diamonds']}' /> Toc Credits: \$<input type='text' name='credits' value='{$itemi['credits']}' /> Donator Days: \$<input type='text' name='donatordays' value='{$itemi['donatordays']}' /> Crystals: <input type='text' name='crystals' value='{$itemi['crystals']}' /> Hospital time: <input type='text' name='hospital' value='{$itemi['hospital']}' /> Hospital reason: <input type='text' name='hospreason' value='{$itemi['hospreason']}' /> <h4>Stats</h4> Strength: <input type='text' name='strength' value='{$itemi['strength']}' /> Agility: <input type='text' name='agility' value='{$itemi['agility']}' /> Guard: <input type='text' name='guard' value='{$itemi['guard']}' /> Labour: <input type='text' name='labour' value='{$itemi['labour']}' /> IQ: <input type='text' name='IQ' value='{$itemi['IQ']}' /> <input type='submit' value='Edit Monster' /></form>"; } function edit_monster_sub() { global $db,$ir,$c,$h,$monsterid; if($ir['user_level'] != 2) { die("403"); } $go=0; if(!isset($_POST['level'])) { $go=1; } if(!isset($_POST['money'])) { $go=1; } if(!isset($_POST['diamonds'])) { $go=1; } if(!isset($_POST['credits'])) { $go=1; } if(!isset($_POST['donatordays'])) { $go=1; } if(!isset($_POST['crystals'])) { $go=1; } if(!isset($_POST['strength'])) { $go=1; } if(!isset($_POST['agility'])) { $go=1; } if(!isset($_POST['guard'])) { $go=1; } if(!isset($_POST['labour'])) { $go=1; } if(!isset($_POST['IQ'])) { $go=1; } if(!isset($_POST['username'])) { $go=1; } if($go) { print "You did not fully fill out the form."; $_POST['monster']=$_POST['monsterid']; edit_monster_form(); } else { $_POST['level']=(int) $_POST['level']; $_POST['strength']=abs((int) $_POST['strength']); $_POST['agility']=abs((int) $_POST['agility']); $_POST['guard']=abs((int) $_POST['guard']); $_POST['labour']=abs((int) $_POST['labour']); $_POST['IQ']=abs((int) $_POST['IQ']); $_POST['money']=(int) $_POST['money']; $_POST['diamonds']=(int) $_POST['diamonds']; $_POST['credits']=(int) $_POST['credits']; $_POST['crystals']=(int) $_POST['crystals']; $_POST['donatordays']=(int) $_POST['donatordays']; //check for monstername usage $u=$db->query("SELECT * FROM monsters WHERE monstername='{$_POST['monstername']}' and monsterid != {$_POST['monsterid']}"); if($db->num_rows($u) != 0) { print "That monstername is in use, choose another."; print " [url='staff_monstertent.php?action=editmonster']> Back[/url]"; $h->endpage(); exit; } $oq=$db->query("SELECT * FROM monsters WHERE monsterid={$_POST['monsterid']}"); $rm=$db->fetch_row($oq); $hp=50+$_POST['level']*50; $db->query("UPDATE monsters SET monsterame='{$_POST['monstername']}', level={$_POST['level']}, money={$_POST['money']}, crystals={$_POST['crystals']}, hp=$hp, maxhp=$hp, hospital={$_POST['hospital']}, hospreason='{$_POST['hospreason']}' WHERE monsterid={$_POST['monsterid']}"); $db->query("UPDATE monsterstats SET strength={$_POST['strength']}, agility={$_POST['agility']}, guard={$_POST['guard']}, labour={$_POST['labour']}, IQ={$_POST['IQ']} WHERE monsterid={$_POST['monsterid']}"); stafflog_add("Edited monster {$_POST['monstername']} [{$_POST['monsterid']}]"); print "Monster edited...."; } } function delmonster() { global $ir,$c,$h,$monsterid,$db; if($ir['user_level'] != 2) { die("403"); } $undeletable = array('1','2'); // add more IDs here, such as NPCs switch ($_GET['step']) { default: echo "<h3>Deleteing Monster</h3> Here you can delete a monster. <form action='staff_monstertent.php?action=delmonster&step=2' method='post'> User: ".monster_dropdown($c,'monster')." <input type='submit' value='Delete Monster' /></form> OR enter a monster ID to Delete: <form action='staff_monstertent.php?action=delmonster&step=2' method='post'> User: <input type='text' name='monster' value='0' /> <input type='submit' value='Delete Monster' /></form>"; break; case 2: $target = $_POST['monster']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) { die('You cannot delete this monster.'); } $d=$db->query("SELECT monstername FROM monsters WHERE monsterid='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete monster ".$itemi["monstername"]."? <form action='staff_monstertent.php?action=delmonster&step=3' method='post'> <input type='hidden' name='monsterid' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_monstertent.php?action=delmonster';\" /></form>"; break; case 3: $target = $_POST['monsterid']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) { die('You cannot delete this monster.'); } if($_POST['yesorno']=='No') { die("Monster not deleted. [url='staff_monstertent.php?action=delmonster']>Back to main Delete Monsters page.[/url]"); } if ($_POST['yesorno'] != ("No" || "Yes")) die('Eh'); $d=$db->query("SELECT monstername FROM monsters WHERE monsterid='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM monsters WHERE monsterid='$target'"); $db->query("DELETE FROM monsterstats WHERE monsterid='$target'"); echo "Monster {$itemi['monstername']} Deleted. [url='staff_monstertent.php?action=delmonster']>Back to main Delete Monsters page.[/url]"; stafflog_add("Deleted Monster {$itemi['monstername']} [{$_POST['monsterid']}]"); break; } } $h->endpage(); ?>   New sql CREATE TABLE IF NOT EXISTS `monsters` ( `monsterid` int(11) NOT NULL auto_increment, `monstername` varchar(255) NOT NULL default '', `level` int(11) NOT NULL default '0', `hp` int(11) NOT NULL default '0', `maxhp` int(11) NOT NULL default '0', `money` float NOT NULL default '0', `crystals` float NOT NULL default '0', `diamonds` float NOT NULL default '0', `credits` float NOT NULL default '0', `donatordays` int(11) NOT NULL default '0', `gender` enum('Male','Female') NOT NULL default 'Male', `attacking` int(11) NOT NULL default '0', `equip_primary` int(11) NOT NULL default '0', `equip_secondary` int(11) NOT NULL default '0', `equip_armor` int(11) NOT NULL default '0', PRIMARY KEY (`monsterid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10000000 ;   As of right now the monsters/npc uses there fists, but for everyone to know there stats are higher then normal lvl stats when makeing a monster and if u define there lvl as 1 there stats are multiplies by 50 per lvl so say u do make a lvl 1 all there stats includeing hp will be 200 so everyone have fun.
  25. Re: [mccode v2] Monster Tent Well everyone here u all are its the attackmonster.php   <?php $menuhide=1; $atkpage=1; include "globals.php"; $_GET['ID'] == (int) $_GET['ID']; if(!$_GET['ID']) { print "WTF you doing, bro?"; $h->endpage(); exit; } else if($_GET['ID'] == $monsterid) { print "Only the crazy attack themselves."; $h->endpage(); exit; } else if ($ir['hp'] <= 1) { print "Only the crazy attack when their unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; } else if ($_SESSION['attacklost'] == 1) { print "Only the losers of all their EXP attack when they've already lost. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } //get monster data $youdata=$ir; $q=$db->query("SELECT u.*,us.* FROM monsters u LEFT JOIN monsterstats us ON u.monsterid=us.monsterid WHERE u.monsterid={$_GET['ID']}"); $odata=$db->fetch_row($q); $myabbr=($ir['gender']=="Male") ? "his" : "her"; $oabbr=($ir['gender']=="Male") ? "his" : "her"; if($ir['attacking'] && $ir['attacking'] != $_GET['ID']) { print "Bad, bad, bad girl. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } if($odata['hp'] == 1) { print "This monster is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE monsters SET attacking=0 WHERE monsterid=$monsterid"); exit; } else if($odata['hospital']) { print "This monster is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE monsters SET attacking=0 WHERE monsterid=$monsterid"); exit; } else if($ir['hospital']) { print "While in hospital you can't attack. [url='hospital.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE monsters SET attacking=0 WHERE monsterid=$monsterid"); exit; } else if($odata['travelling']) { print "That monster is travelling. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE monsters SET attacking=0 WHERE monsterid=$monsterid"); exit; } print "<table width=100%><tr><td colspan=2 align=center>"; if($_GET['wepid']) { if($_SESSION['attacking']==0 && $ir['attacking'] == 0) { if ($youdata['energy'] >= $youdata['maxenergy']/2) { $youdata['energy']-= floor($youdata['maxenergy']/2); $me=floor($youdata['maxenergy']/2); $db->query("UPDATE users SET energy=energy- {$me} WHERE userid=$userid"); $_SESSION['attacklog']=""; $_SESSION['attackdmg']=0; } else { print "You can only attack someone when you have 50% energy"; $h->endpage(); exit; } } $_SESSION['attacking']=1; $ir['attacking']=$odata['monsterid']; $db->query("UPDATE users SET attacking={$ir['attacking']} WHERE userid=$userid"); $_GET['wepid'] = (int) $_GET['wepid']; $_GET['nextstep'] = (int) $_GET['nextstep']; //damage if($_GET['wepid'] != $ir['equip_primary'] && $_GET['wepid'] != $ir['equip_secondary']) { print "Stop trying to abuse a game bug. You can lose all your EXP for that. [url='index.php']> Home[/url]"; $db->query("UPDATE users SET exp=0 where userid=$userid",$c); die(""); } $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$_GET['wepid']}"); $r1=$db->fetch_row($qo); $mydamage=(int) (($r1['weapon']*$youdata['strength']/($odata['guard']/1.5))*(rand(8000,12000)/10000)); $hitratio=max(10,min(60*$ir['agility']/$odata['agility'],95)); if(rand(1,100) <= $hitratio ) { $q3=$db->query("SELECT i.armor FROM items i WHERE itmid={$odata['equip_armor']} ORDER BY rand()"); if($db->num_rows($q3)) { $mydamage-=$db->fetch_single($q3); } if($mydamage < -100000) { $mydamage=abs($mydamage); } else if($mydamage < 1) { $mydamage=1; } $crit=rand(1,40); if($crit==17) { $mydamage*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $mydamage/=(rand(20,40)/10); } $mydamage=round($mydamage); $odata['hp']-=$mydamage; if($odata['hp']==1) { $odata['hp']=0;$mydamage+=1; } $db->query("UPDATE users SET hp=hp-$mydamage WHERE userid={$_GET['ID']}"); print "<font color=red>{$_GET['nextstep']}. Using your {$r1['itmname']} you hit {$odata['monstername']} doing $mydamage damage ({$odata['hp']})</font> \n"; $_SESSION['attackdmg']+=$mydamage; $_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. Using {$myabbr} {$r1['itmname']} {$ir['username']} hit {$odata['monstername']} doing $mydamage damage ({$odata['hp']})</font> \n"; } else { print "<font color=red>{$_GET['nextstep']}. You tried to hit {$odata['monstername']} but missed ({$odata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. {$ir['username']} tried to hit {$odata['monstername']} but missed ({$odata['hp']})</font> \n"; } if($odata['hp'] <= 0) { $odata['hp']=0; $_SESSION['attackwon']=$_GET['ID']; $db->query("UPDATE users SET hp=0 WHERE userid={$_GET['ID']}"); print " [b]What do you want to do with {$odata['monstername']} now?[/b] <form action='attackwon.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Mug Them' /></form> <form action='attackbeat.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Hospitalize Them' /></form> <form action='attacktake.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Leave Them' /></form>"; } else { //choose opp gun $eq=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$odata['equip_primary']}, {$odata['equip_secondary']})"); if(mysql_num_rows($eq) == 0) { $wep="Fists"; $dam=(int)((((int) ($odata['strength']/$ir['guard']/100)) +1)*(rand(8000,12000)/10000)); } else { $cnt=0; while($r=$db->fetch_row($eq)) { $enweps[]=$r; $cnt++; } $weptouse=rand(0,$cnt-1); $wep=$enweps[$weptouse]['itmname']; $dam=(int) (($enweps[$weptouse]['weapon']*$odata['strength']/($youdata['guard']/1.5))*(rand(8000,12000)/10000)); } $hitratio=max(10,min(60*$odata['agility']/$ir['agility'],95)); if(rand(1,100) <= $hitratio) { $q3=$db->query("SELECT i.armor FROM items i WHERE itmid={$ir['equip_armor']} ORDER BY rand()"); if($db->num_rows($q3)) { $dam-=$db->fetch_single($q3); } if($dam < -100000) { $dam=abs($dam); } else if($dam < 1) { $dam=1; } $crit=rand(1,40); if($crit==17) { $dam*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $dam/=(rand(20,40)/10); } $dam=round($dam); $youdata['hp']-=$dam; if ($youdata['hp']==1) { $dam+=1; $youdata['hp']=0; } $db->query("UPDATE users SET hp=hp-$dam WHERE userid=$userid"); $ns=$_GET['nextstep']+1; print "<font color=blue>{$ns}. Using $oabbr $wep {$odata['monstername']} hit you doing $dam damage ({$youdata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=blue>{$ns}. Using $oabbr $wep {$odata['monstername']} hit {$ir['username']} doing $dam damage ({$youdata['hp']})</font> \n"; } else { $ns=$_GET['nextstep']+1; print "<font color=red>{$ns}. {$odata['monstername']} tried to hit you but missed ({$youdata['hp']})</font> \n"; $_SESSION['attacklog'].="<font color=blue>{$ns}. {$odata['monstername']} tried to hit {$ir['username']} but missed ({$youdata['hp']})</font> \n"; } if($youdata['hp'] <= 0) { $youdata['hp']=0; $_SESSION['attacklost']=1; $db->query("UPDATE users SET hp=0 WHERE userid=$userid"); print "<form action='attacklost.php?ID={$_GET['ID']}' method='post'><input type='submit' value='Continue' />"; } } } else if ($odata['hp'] < 5) { print "You can only attack those who have health"; $h->endpage(); exit; } else if ($youdata['energy'] < $youdata['maxenergy']/2) { print "You can only attack someone when you have 50% energy"; $h->endpage(); exit; } else { } print "</td></tr>"; if($youdata['hp'] <= 0 || $odata['hp'] <= 0) { print "</table>"; } else { $vars['hpperc']=round($youdata['hp']/$youdata['maxhp']*100); $vars['hpopp']=100-$vars['hpperc']; $vars2['hpperc']=round($odata['hp']/$odata['maxhp']*100); $vars2['hpopp']=100-$vars2['hpperc']; $mw=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']})"); print "<tr><td colspan=2 align='center'>Attack with: "; if($db->num_rows($mw) > 0) { while($r=$db->fetch_row($mw)) { if(!$_GET['nextstep']) { $ns=1; } else { $ns=$_GET['nextstep']+2; } if($r['itmid']==$ir['equip_primary']) { print "[b]Primary Weapon:[/b] "; } if($r['itmid']==$ir['equip_secondary']) { print "[b]Secondary Weapon:[/b] "; } print "[url='attackmonster.php?nextstep=$ns&ID={$_GET[']{$r['itmname']}[/url] "; } } else { print "You have nothing to fight with."; } print "</table>"; print "<table width='50%' align='center'><tr><td align=right>Your Health: </td><td><img src=greenbar.png width={$vars['hpperc']} height=10><img src=redbar.png width={$vars['hpopp']} height=10></td><tr><td align=right>Opponents Health: </td><td><img src=greenbar.png width={$vars2['hpperc']} height=10><img src=redbar.png width={$vars2['hpopp']} height=10></td></tr></table>"; } $h->endpage(); ?>   It all works, but theres a small error that doesnt affect the battle but i cant seem to figure it out, maybe someone else will heres the error Warning: Division by zero in /home2/user/public_html/*****/attackmonster.php on line 124   ok now that is told and the code above is shown for the attackmonster.php youll need to over write the other files considering i had to edit them some to get the attackmonster.php to work with the users that will attack.
×
×
  • Create New...